public class Triangle
extends java.lang.Object
Constructor and Description |
---|
Triangle(Vector v0,
Vector v1,
Vector v2)
Constructs a triangle with the given vertices (counter-clockwise)
|
Modifier and Type | Method and Description |
---|---|
boolean |
above(Vector pt)
Returns whether the given point is above the plane the triangle is in.
|
boolean |
below(Vector pt)
Returns whether the given point is above the plane the triangle is in.
|
Edge |
getEdge(int index)
Returns the triangle's edge with the given index, counter-clockwise.
|
Vector |
getVertex(int index)
Returns the triangle's vertex with the given index, counter-clockwise.
|
Triangle |
tag(java.lang.String tag)
Set the triangle's tag.
|
java.lang.String |
toString() |
public Vector getVertex(int index)
index
- Vertex index. Valid input: 0..2public Edge getEdge(int index)
index
- Edge index. Valid input: 0..2public boolean below(Vector pt)
pt
- the point to testpublic boolean above(Vector pt)
pt
- the point to testpublic Triangle tag(java.lang.String tag)
tag
- the tagpublic java.lang.String toString()
toString
in class java.lang.Object