|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.math.Triangle
public final class Triangle
A triangle defined by three vertices (in CCW winding order).
| Field Summary | |
|---|---|
static Comparator<Triangle> |
X_COMPARATOR
Compares triangles based on the x coordinates of their centers. |
static Comparator<Triangle> |
Y_COMPARATOR
Compares triangles based on the y coordinates of their centers. |
static Comparator<Triangle> |
Z_COMPARATOR
Compares triangles based on the z coordinates of their centers. |
| Constructor Summary | |
|---|---|
Triangle()
Creates a triangle whose vertices are zero vectors. |
|
Triangle(Triangle other)
Copy constructor. |
|
Triangle(Vector3f v1,
Vector3f v2,
Vector3f v3)
Creates a triangle from the values contained in the supplied objects. |
|
| Method Summary | |
|---|---|
Triangle |
flipLocal()
Flips the orientation of the triangle by swapping the second and third vertices. |
Vector3f |
getCenter()
Returns the center of the triangle as a new vector. |
float |
getCenterX()
Returns the x coordinate of the triangle's center. |
float |
getCenterY()
Returns the y coordinate of the triangle's center. |
float |
getCenterZ()
Returns the z coordinate of the triangle's center. |
Vector3f |
getFirstVertex()
Returns a reference to the triangle's first vertex. |
boolean |
getIntersection(Ray3D ray,
Vector3f result)
Computes the intersection of the supplied ray with this triangle, placing the result in the given vector (if the ray intersects). |
Vector3f |
getSecondVertex()
Returns a reference to the triangle's second vertex. |
Vector3f |
getThirdVertex()
Returns a reference to the triangle's third vertex. |
Vector3f |
getVertex(int idx)
Returns a reference to the vertex at the specified index. |
Triangle |
set(Triangle other)
Sets the vertices of the triangle to those of the specified other triangle. |
Triangle |
set(Vector3f v1,
Vector3f v2,
Vector3f v3)
Sets the vertices of the triangle to those contained in the supplied objects. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Comparator<Triangle> X_COMPARATOR
public static final Comparator<Triangle> Y_COMPARATOR
public static final Comparator<Triangle> Z_COMPARATOR
| Constructor Detail |
|---|
public Triangle(Vector3f v1,
Vector3f v2,
Vector3f v3)
public Triangle(Triangle other)
public Triangle()
| Method Detail |
|---|
public Vector3f getFirstVertex()
public Vector3f getSecondVertex()
public Vector3f getThirdVertex()
public Vector3f getVertex(int idx)
public Vector3f getCenter()
public float getCenterX()
public float getCenterY()
public float getCenterZ()
public Triangle flipLocal()
public Triangle set(Triangle other)
public Triangle set(Vector3f v1,
Vector3f v2,
Vector3f v3)
public boolean getIntersection(Ray3D ray,
Vector3f result)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||