|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.spatial.polygons.Polygon
org.openmali.spatial.polygons.Triangle
public class Triangle
A Triangle is composed of three vertices.
| Constructor Summary | |
|---|---|
Triangle()
|
|
Triangle(int features,
int texCoordsSize)
|
|
| Method Summary | |
|---|---|
void |
addFeature(int feature)
|
float |
getAngleA()
Calculates angle between the edges AC and AB. |
float |
getAngleB()
Calculates angle between the edges BA and BC. |
float |
getAngleC()
Calculates angle between the edges CB and CA. |
Vector3f |
getFaceNormal()
Calculates and returns the face normal. |
void |
getFaceNormal(Vector3f faceNormal)
Calculates the face normal and writes it to the parameter. |
Vector3f |
getFaceNormalACAB()
Calculates the face normal from the cross product of edge AC and AB. |
void |
getFaceNormalACAB(Vector3f faceNormal)
Calculates the face normal from the cross product of edge AC and AB. |
Vector3f |
getFaceNormalBABC()
Calculates the face normal from the cross product of edge BA and BC. |
void |
getFaceNormalBABC(Vector3f faceNormal)
Calculates the face normal from the cross product of edge BA and BC. |
Vector3f |
getFaceNormalCBCA()
Calculates the face normal from the cross product of edge AB and AC. |
void |
getFaceNormalCBCA(Vector3f faceNormal)
Calculates the face normal from the cross product of edge AB and AC. |
void |
getVertexA(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
|
void |
getVertexB(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
|
void |
getVertexC(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
|
Colorf |
getVertexColorA()
|
void |
getVertexColorA(Colorf color)
|
Colorf |
getVertexColorB()
|
void |
getVertexColorB(Colorf color)
|
Colorf |
getVertexColorC()
|
void |
getVertexColorC(Colorf color)
|
void |
getVertexColors(Colorf colorA,
Colorf colorB,
Colorf colorC)
|
Point3f |
getVertexCoordA()
|
void |
getVertexCoordA(Tuple3f coord)
|
Point3f |
getVertexCoordB()
|
void |
getVertexCoordB(Tuple3f coord)
|
Point3f |
getVertexCoordC()
|
void |
getVertexCoordC(Tuple3f coord)
|
void |
getVertexCoords(Tuple3f coordA,
Tuple3f coordB,
Tuple3f coordC)
|
int |
getVertexIndexA()
|
int |
getVertexIndexB()
|
int |
getVertexIndexC()
|
Vector3f |
getVertexNormalA()
|
void |
getVertexNormalA(Vector3f normal)
|
Vector3f |
getVertexNormalB()
|
void |
getVertexNormalB(Vector3f normal)
|
Vector3f |
getVertexNormalC()
|
void |
getVertexNormalC(Vector3f normal)
|
void |
getVertexNormals(Vector3f normalA,
Vector3f normalB,
Vector3f normalC)
|
TexCoord2f |
getVertexTexCoordA()
|
void |
getVertexTexCoordA(TexCoord2f texCoord)
|
TexCoord2f |
getVertexTexCoordB()
|
void |
getVertexTexCoordB(TexCoord2f texCoord)
|
TexCoord2f |
getVertexTexCoordC()
|
void |
getVertexTexCoordC(TexCoord2f texCoord)
|
void |
getVertexTexCoords(TexCoord2f texCoordA,
TexCoord2f texCoordB,
TexCoord2f texCoordC)
|
float |
intersects(Point3f rayOrigin,
Vector3f rayDirection)
Tests the triangle for intersection with a ray. |
float |
intersects(Ray3f ray)
Tests the triangle for intersection with a ray. |
float |
intersects(Ray3f ray,
float nearestDist)
Tests the triangle for intersection with a ray. |
boolean |
quickIntersectionTest(Ray3f pickRay)
Does a quick ray-intersection test, that doesn't very precise. |
void |
setFeatures(int features)
|
void |
setVertexA(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
|
void |
setVertexB(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
|
void |
setVertexC(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
|
void |
setVertexColorA(Colorf color)
|
void |
setVertexColorB(Colorf color)
|
void |
setVertexColorC(Colorf color)
|
void |
setVertexColors(Colorf colorA,
Colorf colorB,
Colorf colorC)
|
void |
setVertexCoordA(Tuple3f coord)
|
void |
setVertexCoordB(Tuple3f coord)
|
void |
setVertexCoordC(Tuple3f coord)
|
void |
setVertexCoords(Tuple3f coordA,
Tuple3f coordB,
Tuple3f coordC)
|
void |
setVertexIndexA(int index)
Sets the index of the vertexA (just meta info). |
void |
setVertexIndexB(int index)
Sets the index of the vertexB (just meta info). |
void |
setVertexIndexC(int index)
Sets the index of the vertexC (just meta info). |
void |
setVertexIndices(int indexA,
int indexB,
int indexC)
Sets the indices of the vertices A, B, C (just meta info). |
void |
setVertexNormalA(Vector3f normal)
|
void |
setVertexNormalB(Vector3f normal)
|
void |
setVertexNormalC(Vector3f normal)
|
void |
setVertexNormals(Vector3f normalA,
Vector3f normalB,
Vector3f normalC)
|
void |
setVertexTexCoordA(TexCoord2f texCoord)
|
void |
setVertexTexCoordB(TexCoord2f texCoord)
|
void |
setVertexTexCoordC(TexCoord2f texCoord)
|
void |
setVertexTexCoords(TexCoord2f texCoordA,
TexCoord2f texCoordB,
TexCoord2f texCoordC)
|
int |
sign3D(Tuple3f a,
Tuple3f b,
Tuple3f c,
Tuple3f d)
|
void |
transform(Matrix4f matrix)
|
| Methods inherited from class org.openmali.spatial.polygons.Polygon |
|---|
getFeatures, getTexCoordsSize, hasFeature, removeFeature, setTexCoordsSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Triangle(int features,
int texCoordsSize)
public Triangle()
| Method Detail |
|---|
public void setFeatures(int features)
setFeatures in class Polygonpublic void addFeature(int feature)
addFeature in class Polygonpublic void setVertexCoordA(Tuple3f coord)
public void setVertexCoordB(Tuple3f coord)
public void setVertexCoordC(Tuple3f coord)
public void getVertexCoordA(Tuple3f coord)
public Point3f getVertexCoordA()
public void getVertexCoordB(Tuple3f coord)
public Point3f getVertexCoordB()
public void getVertexCoordC(Tuple3f coord)
public Point3f getVertexCoordC()
public void setVertexCoords(Tuple3f coordA,
Tuple3f coordB,
Tuple3f coordC)
public void getVertexCoords(Tuple3f coordA,
Tuple3f coordB,
Tuple3f coordC)
public void setVertexNormalA(Vector3f normal)
public void setVertexNormalB(Vector3f normal)
public void setVertexNormalC(Vector3f normal)
public void getVertexNormalA(Vector3f normal)
public Vector3f getVertexNormalA()
public void getVertexNormalB(Vector3f normal)
public Vector3f getVertexNormalB()
public void getVertexNormalC(Vector3f normal)
public Vector3f getVertexNormalC()
public void setVertexNormals(Vector3f normalA,
Vector3f normalB,
Vector3f normalC)
public void getVertexNormals(Vector3f normalA,
Vector3f normalB,
Vector3f normalC)
public void setVertexColorA(Colorf color)
public void setVertexColorB(Colorf color)
public void setVertexColorC(Colorf color)
public void getVertexColorA(Colorf color)
public Colorf getVertexColorA()
public void getVertexColorB(Colorf color)
public Colorf getVertexColorB()
public void getVertexColorC(Colorf color)
public Colorf getVertexColorC()
public void setVertexColors(Colorf colorA,
Colorf colorB,
Colorf colorC)
public void getVertexColors(Colorf colorA,
Colorf colorB,
Colorf colorC)
public void setVertexTexCoordA(TexCoord2f texCoord)
public void setVertexTexCoordB(TexCoord2f texCoord)
public void setVertexTexCoordC(TexCoord2f texCoord)
public void getVertexTexCoordA(TexCoord2f texCoord)
public TexCoord2f getVertexTexCoordA()
public void getVertexTexCoordB(TexCoord2f texCoord)
public TexCoord2f getVertexTexCoordB()
public void getVertexTexCoordC(TexCoord2f texCoord)
public TexCoord2f getVertexTexCoordC()
public void setVertexTexCoords(TexCoord2f texCoordA,
TexCoord2f texCoordB,
TexCoord2f texCoordC)
public void getVertexTexCoords(TexCoord2f texCoordA,
TexCoord2f texCoordB,
TexCoord2f texCoordC)
public void setVertexA(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
public void getVertexA(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
public void setVertexB(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
public void getVertexB(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
public void setVertexC(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
public void getVertexC(Tuple3f coord,
Vector3f normal,
Colorf color,
TexCoord2f texCoord)
public float getAngleA()
public float getAngleB()
public float getAngleC()
public void getFaceNormalACAB(Vector3f faceNormal)
faceNormal - public Vector3f getFaceNormalACAB()
public void getFaceNormalBABC(Vector3f faceNormal)
faceNormal - public Vector3f getFaceNormalBABC()
public void getFaceNormalCBCA(Vector3f faceNormal)
faceNormal - public Vector3f getFaceNormalCBCA()
public void getFaceNormal(Vector3f faceNormal)
faceNormal - public Vector3f getFaceNormal()
public void setVertexIndexA(int index)
index - public int getVertexIndexA()
public void setVertexIndexB(int index)
index - public int getVertexIndexB()
public void setVertexIndexC(int index)
index - public int getVertexIndexC()
public void setVertexIndices(int indexA,
int indexB,
int indexC)
indexA - indexB - indexC -
public int sign3D(Tuple3f a,
Tuple3f b,
Tuple3f c,
Tuple3f d)
public boolean quickIntersectionTest(Ray3f pickRay)
pickRay -
public float intersects(Point3f rayOrigin,
Vector3f rayDirection)
rayOrigin - rayDirection -
public float intersects(Ray3f ray)
ray -
public float intersects(Ray3f ray,
float nearestDist)
ray - nearestDist - the nearest distance to be accepted (for optimizations)
public void transform(Matrix4f matrix)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||