|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.rico.engine.geometry.Triangle
public class Triangle
This class represents a triangle (polygon) that can be part of a mesh.
Constructor Summary | |
---|---|
Triangle(Point3D p1,
Point3D p2,
Point3D p3)
Creates a triangle with the specified points as vertices. |
|
Triangle(Point3D p1,
Point3D p2,
Point3D p3,
boolean calcNormal)
Creates a triangle with the specified points as vertices. |
Method Summary | |
---|---|
void |
calculateNormals()
Calculates the normal for the triangle |
Triangle |
clone()
|
float |
getLengthV1V2()
Returns the length of the edge between vertex1 and vertex2 |
float |
getLengthV1V3()
Returns the length of the edge between vertex1 and vertex3 |
float |
getLengthV2V3()
Returns the length of the edge between vertex2 and vertex3 |
Point3D |
getVertex1()
Gets the first vertex of the triangle. |
Point3D |
getVertex2()
Gets the second vertex of the triangle. |
Point3D |
getVertex3()
Gets the third vertex of the triangle. |
Point3D[] |
getVertices()
Returns an array with the three vertices of the triangle |
boolean |
hasVertex(Point3D vert)
Checks whether the specified vertex is a vertex of the triangle |
void |
setVertex1(Point3D point)
Sets the first vertex if the triangle |
void |
setVertex2(Point3D point)
Sets the second vertex if the triangle |
void |
setVertex3(Point3D point)
Sets the third vertex if the triangle |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Triangle(Point3D p1, Point3D p2, Point3D p3)
p1
- point that will be vertex1p2
- point that will be vertex2p3
- point that will be vertex3public Triangle(Point3D p1, Point3D p2, Point3D p3, boolean calcNormal)
null
object as a normal
p1
- point that will be vertex1p2
- point that will be vertex2p3
- point that will be vertex3calcNormal
- calculate normals? --> true=yes, false=noMethod Detail |
---|
public void calculateNormals()
public float getLengthV1V2()
public float getLengthV1V3()
public float getLengthV2V3()
public Point3D[] getVertices()
public Point3D getVertex1()
public void setVertex1(Point3D point)
point
- point that will be the first vertexpublic Point3D getVertex2()
public void setVertex2(Point3D point)
point
- point that will be the second vertexpublic Point3D getVertex3()
public void setVertex3(Point3D point)
point
- that will be the third vertexpublic boolean hasVertex(Point3D vert)
vert
- vertex to check with triangle
public Triangle clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |