|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Geometry
com.jme.scene.QuadMesh
public class QuadMesh
QuadMesh defines a geometry mesh. This mesh defines a three
dimensional object via a collection of points, colors, normals and textures.
The points are referenced via a indices array. This array instructs the
renderer the order in which to draw the points, creating quads based on the mode set.
| Nested Class Summary | |
|---|---|
static class |
QuadMesh.Mode
|
| Nested classes/interfaces inherited from class com.jme.scene.Spatial |
|---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
| Field Summary | |
|---|---|
protected java.nio.IntBuffer |
indexBuffer
|
protected QuadMesh.Mode |
mode
|
protected int |
quadQuantity
|
| Fields inherited from class com.jme.scene.Geometry |
|---|
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity |
| Fields inherited from class com.jme.scene.Spatial |
|---|
collisionBits, cullHint, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
|---|---|
QuadMesh()
Empty Constructor to be used internally only. |
|
QuadMesh(java.lang.String name)
Constructor instantiates a new TriMesh object. |
|
QuadMesh(java.lang.String name,
java.nio.FloatBuffer vertices,
java.nio.FloatBuffer normal,
java.nio.FloatBuffer color,
TexCoords coords,
java.nio.IntBuffer indices)
Constructor instantiates a new TriMesh object. |
|
| Method Summary | |
|---|---|
void |
clearBuffers()
Clears the buffers of this QuadMesh. |
void |
draw(Renderer r)
draw prepares the geometry for rendering to the display. |
void |
findCollisions(Spatial scene,
CollisionResults results,
int requiredOnBits)
checks this spatial against a second spatial, any collisions are stored in the results object. |
java.nio.IntBuffer |
getIndexBuffer()
|
int |
getMaxIndex()
|
Vector3f[] |
getMeshAsQuadsVertices(Vector3f[] verts)
Return this mesh object as quads. |
QuadMesh.Mode |
getMode()
|
void |
getQuad(int i,
int[] storage)
Stores in the storage array the indices of quad
i. |
void |
getQuad(int i,
Vector3f[] vertices)
Stores in the vertices array the vertex values of quad
i. |
int |
getQuadCount()
Returns the number of triangles contained in this mesh. |
static Vector3f[] |
getQuads()
|
protected int |
getVertIndex(int quad,
int point)
|
boolean |
hasCollision(Spatial scene,
boolean checkTriangles,
int requiredOnBits)
Checks this spatial against a second spatial for collisions. |
void |
read(JMEImporter e)
|
protected void |
recalcQuadQuantity()
|
void |
reconstruct(java.nio.FloatBuffer vertices,
java.nio.FloatBuffer normal,
java.nio.FloatBuffer color,
TexCoords coords,
java.nio.IntBuffer indices)
Recreates the geometric information of this TriMesh from scratch. |
void |
setIndexBuffer(java.nio.IntBuffer indices)
|
void |
setMode(QuadMesh.Mode mode)
|
void |
setQuadQuantity(int quadQuantity)
|
static void |
setQuads(Vector3f[] quads)
|
void |
write(JMEExporter e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.jme.util.export.Savable |
|---|
getClassTag |
| Field Detail |
|---|
protected transient java.nio.IntBuffer indexBuffer
protected QuadMesh.Mode mode
protected int quadQuantity
| Constructor Detail |
|---|
public QuadMesh()
public QuadMesh(java.lang.String name)
TriMesh object.
name - the name of the scene element. This is required for
identification and comparison purposes.
public QuadMesh(java.lang.String name,
java.nio.FloatBuffer vertices,
java.nio.FloatBuffer normal,
java.nio.FloatBuffer color,
TexCoords coords,
java.nio.IntBuffer indices)
TriMesh object. Provided
are the attributes that make up the mesh all attributes may be null,
except for vertices and indices.
name - the name of the scene element. This is required for
identification and comparison purposes.vertices - the vertices of the geometry.normal - the normals of the geometry.color - the colors of the geometry.coords - the texture coordinates of the mesh.indices - the indices of the vertex array.| Method Detail |
|---|
public void reconstruct(java.nio.FloatBuffer vertices,
java.nio.FloatBuffer normal,
java.nio.FloatBuffer color,
TexCoords coords,
java.nio.IntBuffer indices)
vertices array that
References a vertex of a triangle.
vertices - The vertex information for this TriMesh.normal - The normal information for this TriMesh.color - The color information for this TriMesh.coords - The texture information for this TriMesh.indices - The index information for this TriMesh.public void setMode(QuadMesh.Mode mode)
public QuadMesh.Mode getMode()
public java.nio.IntBuffer getIndexBuffer()
public void setIndexBuffer(java.nio.IntBuffer indices)
protected void recalcQuadQuantity()
public int getQuadCount()
public void setQuadQuantity(int quadQuantity)
public void clearBuffers()
clearBuffers in class Geometrypublic static Vector3f[] getQuads()
public static void setQuads(Vector3f[] quads)
public void getQuad(int i,
int[] storage)
storage array the indices of quad
i. If i is an invalid index, or if
storage.length<4, then nothing happens
i - The index of the quad to get.storage - The array that will hold the i's indexes.
public void getQuad(int i,
Vector3f[] vertices)
vertices array the vertex values of quad
i. If i is an invalid quad index,
nothing happens.
i - vertices - public Vector3f[] getMeshAsQuadsVertices(Vector3f[] verts)
verts - a storage array to place the results in
protected int getVertIndex(int quad,
int point)
public int getMaxIndex()
public void write(JMEExporter e)
throws java.io.IOException
write in interface Savablewrite in class Geometryjava.io.IOException
public void read(JMEImporter e)
throws java.io.IOException
read in interface Savableread in class Geometryjava.io.IOExceptionpublic void draw(Renderer r)
Geometrydraw prepares the geometry for rendering to the display.
The renderstate is set and the subclass is responsible for rendering the
actual data.
draw in class Geometryr - the renderer that displays to the context.Spatial.draw(com.jme.renderer.Renderer)
public void findCollisions(Spatial scene,
CollisionResults results,
int requiredOnBits)
Spatial
findCollisions in class Spatialscene - the scene to test against.results - the results of the collisions.requiredOnBits - considered a collision only if these bits are 'on'
in both 'this' and the 'scene' spatial.
public boolean hasCollision(Spatial scene,
boolean checkTriangles,
int requiredOnBits)
Spatial
hasCollision in class Spatialscene - the scene to test against.checkTriangles - check for collisions on triangle accuracy levelrequiredOnBits - considered a collision only if these bits are 'on'
in both 'this' and the 'scene' spatial.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||