com.robrohan.ruin.doom
Class Seg

java.lang.Object
  |
  +--com.robrohan.ruin.doom.Seg
All Implemented Interfaces:
java.io.Serializable

public class Seg
extends java.lang.Object
implements java.io.Serializable

The SEGS are stored in a sequential order determined by the SSECTORS, which are part of the NODES recursive tree For diagonal segs, the offset distance can be obtained from the formula DISTANCE = SQR((x2 - x1)^2 + (y2 - y1)^2). The angle can be calculated from the inverse tangent of the dx and dy in the vertices, multiplied to convert PI/2 radians (90 degrees) to 16384. And since most arctan functions return a value between -(pi/2) and (pi/2), you'll have to do some tweaking based on the sign of (x2-x1), to account for segs that go "west".

See Also:
Serialized Form

Constructor Summary
Seg(int fromVertex, int toVertex, int linedefNo, boolean rightSide, int offset)
          make a new segment
 
Method Summary
 void compile(DoomLevel level)
           
 int getFromVertex()
           
 Linedef getLinedef()
           
 int getOffset()
           
 Sector getSector()
           
 Sidedef getSidedef()
           
 int getToVertex()
           
 boolean isRightSide()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Seg

public Seg(int fromVertex,
           int toVertex,
           int linedefNo,
           boolean rightSide,
           int offset)
make a new segment

Method Detail

isRightSide

public boolean isRightSide()

getFromVertex

public int getFromVertex()

getToVertex

public int getToVertex()

getOffset

public int getOffset()

compile

public void compile(DoomLevel level)

getSidedef

public Sidedef getSidedef()

getLinedef

public Linedef getLinedef()

getSector

public Sector getSector()