|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.javagl.swogl.geometry.GeometryUtils
public class GeometryUtils
A class offering utility methods for Geometries
Method Summary | |
---|---|
static Box |
computeBoundingBox(Geometry geometry)
Computes the bounding Box of the given Geometry |
static Box |
computeBoundingBox(Geometry geometry,
javax.vecmath.Matrix4f matrix)
Computes the bounding Box of the given Geometry
when it is transformed with the given matrix. |
static void |
getNormals(Geometry geometry,
int triangleIndex,
javax.vecmath.Tuple3f n0,
javax.vecmath.Tuple3f n1,
javax.vecmath.Tuple3f n2)
Write the normals of the vertices of the specified triangle of the given Geometry into the given tuples |
static void |
getTexCoords(Geometry geometry,
int triangleIndex,
javax.vecmath.Tuple2f t0,
javax.vecmath.Tuple2f t1,
javax.vecmath.Tuple2f t2)
Write the texture coordinates of the vertices of the specified triangle of the given Geometry into the given tuples |
static void |
getVertex(Geometry geometry,
int triangleIndex,
int vertexNumber,
javax.vecmath.Tuple3f vertex,
javax.vecmath.Tuple3f normal,
javax.vecmath.Tuple2f texCoord)
Obtain the position, normal and texture coordinates of the specified vertex from the given Geometry . |
static void |
getVertices(Geometry geometry,
int triangleIndex,
javax.vecmath.Tuple3f v0,
javax.vecmath.Tuple3f v1,
javax.vecmath.Tuple3f v2)
Write the positions of the vertices of the specified triangle of the given Geometry into the given tuples |
static void |
transform(Geometry geometry,
javax.vecmath.Matrix4f matrix)
Transform the given Geometry with the given matrix |
static void |
updateNormals(Geometry geometry)
Update the vertex normals of the given Geometry by computing
the average of the normals of the triangles that are
adjacent to the respective vertex. |
static void |
writeIndicesToBuffer(Geometry geometry,
java.nio.IntBuffer buffer)
Writes the indices of the given Geometry into the given
buffer. |
static void |
writeNormalsToBuffer(Geometry geometry,
java.nio.FloatBuffer buffer)
Writes the normals of the given Geometry into the given
buffer. |
static void |
writeTexCoordsToBuffer(Geometry geometry,
java.nio.FloatBuffer buffer)
Writes the texture coordinates of the given Geometry into
the given buffer. |
static void |
writeVerticesToBuffer(Geometry geometry,
java.nio.FloatBuffer buffer)
Writes the vertices of the given Geometry into the given
buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void writeIndicesToBuffer(Geometry geometry, java.nio.IntBuffer buffer)
Geometry
into the given
buffer.n
triangles, it must at least
have a size of n*3
.
geometry
- The Geometry
buffer
- The target bufferpublic static void writeVerticesToBuffer(Geometry geometry, java.nio.FloatBuffer buffer)
Geometry
into the given
buffer.n
vertices, it must at least
have a size of n*3
.
geometry
- The geometrybuffer
- The target bufferpublic static void writeNormalsToBuffer(Geometry geometry, java.nio.FloatBuffer buffer)
Geometry
into the given
buffer.n
vertices, it must at least
have a size of n*3
.
geometry
- The Geometry
buffer
- The target bufferpublic static void writeTexCoordsToBuffer(Geometry geometry, java.nio.FloatBuffer buffer)
Geometry
into
the given buffer.n
vertices, it must at least
have a size of n*2
.
geometry
- The Geometry
buffer
- The target bufferpublic static void getVertex(Geometry geometry, int triangleIndex, int vertexNumber, javax.vecmath.Tuple3f vertex, javax.vecmath.Tuple3f normal, javax.vecmath.Tuple2f texCoord)
Geometry
.
geometry
- The Geometry
triangleIndex
- The triangle indexvertexNumber
- The number of the vertex inside the trianglevertex
- Will store the vertex positionnormal
- Will store the vertex normaltexCoord
- Will store the vertex texture coordinatespublic static void getVertices(Geometry geometry, int triangleIndex, javax.vecmath.Tuple3f v0, javax.vecmath.Tuple3f v1, javax.vecmath.Tuple3f v2)
Geometry
into the given tuples
geometry
- The Geometry
triangleIndex
- The triangle indexv0
- The first vertexv1
- The second vertexv2
- The third vertexpublic static void getTexCoords(Geometry geometry, int triangleIndex, javax.vecmath.Tuple2f t0, javax.vecmath.Tuple2f t1, javax.vecmath.Tuple2f t2)
Geometry
into the given tuples
geometry
- The Geometry
triangleIndex
- The triangle indext0
- The first texture coordinatet1
- The second texture coordinatet2
- The third texture coordinatepublic static void getNormals(Geometry geometry, int triangleIndex, javax.vecmath.Tuple3f n0, javax.vecmath.Tuple3f n1, javax.vecmath.Tuple3f n2)
Geometry
into the given tuples
geometry
- The Geometry
triangleIndex
- The triangle indexn0
- The first normaln1
- The second normaln2
- The third normalpublic static void updateNormals(Geometry geometry)
Geometry
by computing
the average of the normals of the triangles that are
adjacent to the respective vertex. This method is not thread
safe, and may only be called by one thread at a time.
geometry
- The Geometry
public static Box computeBoundingBox(Geometry geometry)
Box
of the given Geometry
geometry
- The Geometry
Box
public static Box computeBoundingBox(Geometry geometry, javax.vecmath.Matrix4f matrix)
Box
of the given Geometry
when it is transformed with the given matrix.
geometry
- The Geometry
matrix
- The matrix
Box
public static void transform(Geometry geometry, javax.vecmath.Matrix4f matrix)
Geometry
with the given matrix
geometry
- The Geometry
matrix
- The matrix
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |