java.lang.Object | |
↳ | org.andengine.util.algorithm.collision.BaseCollisionChecker |
Known Direct Subclasses |
Known Indirect Subclasses |
(c) 2010 Nicolas Gramlich (c) 2011 Zynga Inc.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an indicator of where the specified point (PX, PY) lies with
respect to the line segment from (X1, Y1) to (X2, Y2).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns an indicator of where the specified point (PX, PY) lies with respect to the line segment from (X1, Y1) to (X2, Y2). The return value can be either 1, -1, or 0 and indicates in which direction the specified line must pivot around its first endpoint, (X1, Y1), in order to point at the specified point (PX, PY).
A return value of 1 indicates that the line segment must turn in the direction that takes the positive X axis towards the negative Y axis. In the default coordinate system used by Java 2D, this direction is counterclockwise.
A return value of -1 indicates that the line segment must turn in the direction that takes the positive X axis towards the positive Y axis. In the default coordinate system, this direction is clockwise.
A return value of 0 indicates that the point lies exactly on the line segment. Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues.
If the point is colinear with the line segment, but not between the endpoints, then the value will be -1 if the point lies "beyond (X1, Y1)" or 1 if the point lies "beyond (X2, Y2)".
pX1 | , Y1 the coordinates of the beginning of the specified line segment |
---|---|
pX2 | , Y2 the coordinates of the end of the specified line segment |
pPX | , PY the coordinates of the specified point to be compared with the specified line segment |