|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.math.Line
public class Line
A line consisting of a unit normal and a constant. All points on the line satisfy the
equation Ax + By + C = 0, where (A, B) is the line normal and C is the
constant.
| Field Summary | |
|---|---|
float |
constant
The line constant. |
static Line |
X_AXIS
The X axis. |
static Line |
Y_AXIS
The Y axis. |
| Constructor Summary | |
|---|---|
Line()
Creates an empty (invalid) line. |
|
Line(float a,
float b,
float c)
Creates a line with the specified parameters. |
|
Line(Line other)
Copy constructor. |
|
Line(Vector2f normal,
float constant)
Creates a line from the specified normal and constant. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object other)
|
Line |
fromPoints(Vector2f p1,
Vector2f p2)
Sets this line based on the two points provided. |
float |
getDistance(Ray2D ray)
Computes the signed distance to this line along the specified ray. |
float |
getDistance(Vector2f pt)
Computes and returns the signed distance from the line to the specified point. |
boolean |
getIntersection(Ray2D ray,
Vector2f result)
Computes the intersection of the supplied ray with this line, placing the result in the given vector (if the ray intersects). |
Vector2f |
getNormal()
Returns a reference to the line normal. |
int |
hashCode()
|
Line |
set(float a,
float b,
float c)
Sets the parameters of the line. |
Line |
set(Line other)
Copies the parameters of another line. |
Line |
set(Vector2f normal,
float constant)
Sets the parameters of the line. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Line X_AXIS
public static final Line Y_AXIS
public float constant
| Constructor Detail |
|---|
public Line(Vector2f normal,
float constant)
public Line(float a,
float b,
float c)
public Line(Line other)
public Line()
| Method Detail |
|---|
public Vector2f getNormal()
public Line fromPoints(Vector2f p1,
Vector2f p2)
public Line set(Line other)
public Line set(Vector2f normal,
float constant)
public Line set(float a,
float b,
float c)
public boolean getIntersection(Ray2D ray,
Vector2f result)
public float getDistance(Ray2D ray)
public float getDistance(Vector2f pt)
public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||