|
||||||||||
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)
put
methods. Thus, the position of the
buffer will remain unaffected.n
triangles, it must at least
have a size of n*3
.
geometry
- The geometrybuffer
- The target bufferpublic static void writeVerticesToBuffer(Geometry geometry, java.nio.FloatBuffer buffer)
put
methods. Thus, the position of the
buffer will remain unaffected.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)
put
methods. Thus, the position of the
buffer will remain unaffected.n
vertices, it must at least
have a size of n*3
.
geometry
- The geometrybuffer
- The target bufferpublic static void writeTexCoordsToBuffer(Geometry geometry, java.nio.FloatBuffer buffer)
put
methods. Thus, the position of the
buffer will remain unaffected.n
vertices, it must at least
have a size of n*2
.
geometry
- The geometrybuffer
- 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
- The geometrytriangleIndex
- 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
- The geometrytriangleIndex
- 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
- The geometrytriangleIndex
- 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
- The geometrytriangleIndex
- The triangle indexn0
- The first normaln1
- The second normaln2
- The third normalpublic static void updateNormals(Geometry geometry)
geometry
- The geometrypublic static Box computeBoundingBox(Geometry geometry)
geometry
- The geometry
public static Box computeBoundingBox(Geometry geometry, javax.vecmath.Matrix4f matrix)
geometry
- The geometrymatrix
- The matrix
public static void transform(Geometry geometry, javax.vecmath.Matrix4f matrix)
geometry
- The geometrymatrix
- The matrix
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |