|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Line2D
java.awt.geom.Line2D.Float
com.brackeen.javagamebook.bsp2D.BSPLine
Nested Class Summary |
Nested classes inherited from class java.awt.geom.Line2D |
java.awt.geom.Line2D.Double, java.awt.geom.Line2D.Float |
Field Summary | |
static int |
BACK
|
float |
bottom
Bottom-most location of a line representing a wall. |
static int |
COLLINEAR
|
static int |
FRONT
|
float |
nx
X coordinate of the line normal. |
float |
ny
Y coordinate of the line normal. |
static int |
SPANNING
|
float |
top
Top-most location of a line representing a wall. |
Fields inherited from class java.awt.geom.Line2D.Float |
x1, x2, y1, y2 |
Constructor Summary | |
BSPLine()
Creates a new line from (0,0) to (0,0) |
|
BSPLine(BSPPolygon poly)
Creates a new BSPLine based on the specified BSPPolygon (only if the BSPPolygon is a vertical wall). |
|
BSPLine(float x1,
float y1,
float x2,
float y2)
Creates a new BSPLine based on the specified coordinates. |
Method Summary | |
void |
calcNormal()
Calculates the normal to this line. |
boolean |
equals(BSPLine line)
Returns true if the endpoints of this line match the endpoints of the specified line. |
boolean |
equalsIgnoreOrder(BSPLine line)
Returns true if the endpoints of this line match the endpoints of the specified line, ignoring endpoint order (if the first point of this line is equal to the second point of the specified line, and vice versa, returns true). |
void |
flip()
Flips this line so that the end points are reversed (in other words, (x1,y1) becomes (x2,y2) and vice versa) and the normal is changed to point the opposite direction. |
float |
getIntersection(java.awt.geom.Line2D.Float line)
Returns the fraction of intersection along this line. |
java.awt.geom.Point2D.Float |
getIntersectionPoint(java.awt.geom.Line2D.Float line)
Returns the interection point of this line with the specified line. |
java.awt.geom.Point2D.Float |
getIntersectionPoint(java.awt.geom.Line2D.Float line,
java.awt.geom.Point2D.Float intersection)
Returns the interection of this line with the specified line. |
int |
getSide(BSPPolygon poly)
Gets the side of this line that the specified polygon is on. |
int |
getSide(java.awt.geom.Line2D.Float segment)
Gets the side of this line that the specified line segment is on. |
int |
getSideThick(float x,
float y)
Gets the side of this line the specified point is on. |
int |
getSideThin(float x,
float y)
Gets the side of this line the specified point is on. |
void |
normalize()
Normalizes the normal of this line (make the normal's length 1). |
void |
setHeight(float top,
float bottom)
Sets the top and bottom height of this "wall". |
void |
setLine(double x1,
double y1,
double x2,
double y2)
|
void |
setLine(float x1,
float y1,
float x2,
float y2)
|
void |
setTo(BSPPolygon poly)
Sets this BSPLine to the specified BSPPolygon (only if the BSPPolygon is a vertical wall). |
java.lang.String |
toString()
|
Methods inherited from class java.awt.geom.Line2D.Float |
getBounds2D, getP1, getP2, getX1, getX2, getY1, getY2 |
Methods inherited from class java.awt.geom.Line2D |
clone, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int BACK
public static final int COLLINEAR
public static final int FRONT
public static final int SPANNING
public float nx
public float ny
public float top
public float bottom
Constructor Detail |
public BSPLine()
public BSPLine(BSPPolygon poly)
public BSPLine(float x1, float y1, float x2, float y2)
Method Detail |
public void setTo(BSPPolygon poly)
public void calcNormal()
public void normalize()
public void setLine(float x1, float y1, float x2, float y2)
public void setLine(double x1, double y1, double x2, double y2)
public void flip()
public void setHeight(float top, float bottom)
public boolean equals(BSPLine line)
public boolean equalsIgnoreOrder(BSPLine line)
public java.lang.String toString()
public int getSideThick(float x, float y)
public int getSideThin(float x, float y)
public int getSide(java.awt.geom.Line2D.Float segment)
public int getSide(BSPPolygon poly)
public float getIntersection(java.awt.geom.Line2D.Float line)
public java.awt.geom.Point2D.Float getIntersectionPoint(java.awt.geom.Line2D.Float line)
public java.awt.geom.Point2D.Float getIntersectionPoint(java.awt.geom.Line2D.Float line, java.awt.geom.Point2D.Float intersection)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |