com.md5importer.model.mesh
Class Mesh

java.lang.Object
  extended by com.jme.scene.Spatial
      extended by com.jme.scene.Geometry
          extended by com.jme.scene.TriMesh
              extended by com.md5importer.model.mesh.Mesh
All Implemented Interfaces:
com.jme.util.export.Savable, IMesh, java.io.Serializable

public class Mesh
extends com.jme.scene.TriMesh
implements IMesh

Mesh defines the concrete implementation of a mesh. It does not directly process any geometric information but delegates the process down to the primitive elements it maintains.

Mesh cannot be cloned directly. The cloning process of a Mesh can only be initiated by the cloning process of the parent IIMD5Node.

This class is used internally by MD5Importer only.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.TriMesh
com.jme.scene.TriMesh.Mode
 
Nested classes/interfaces inherited from class com.jme.scene.Spatial
com.jme.scene.Spatial.CullHint, com.jme.scene.Spatial.LightCombineMode, com.jme.scene.Spatial.NormalsMode, com.jme.scene.Spatial.TextureCombineMode
 
Field Summary
 
Fields inherited from class com.jme.scene.TriMesh
indexBuffer, mode, triangleQuantity
 
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
cullHint, frustrumIntersects, geometricalControllers, isCollidable, 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
Mesh()
          Constructor of Mesh.
Mesh(java.lang.String texture, IVertex[] vertices, ITriangle[] triangles, IWeight[] weights, int anisotropic, com.jme.image.Texture.MinificationFilter miniFilter, com.jme.image.Texture.MagnificationFilter magFilter, boolean orientedBounding)
          Constructor of Mesh.
 
Method Summary
 IMesh clone(IJoint[] clonedJoints)
          Clone this mesh.
 java.lang.Class getClassTag()
           
 IVertex getVertex(int index)
          Retrieve the vertex with given index number.
 IWeight getWeight(int index)
          Retrieve the weight with given index number.
 void initialize(java.lang.String name)
          Initialize this mesh and its geometric data.
 void read(com.jme.util.export.JMEImporter im)
           
static void setExtension(java.lang.String extension)
          Set the texture extension to use.
 void setJoints(IJoint[] joints)
          Set this mesh to use the given joints.
 void swapBuffer()
          Swap the vertex information buffers.
 void updateMesh()
          Update this mesh and its geometric data.
 void write(com.jme.util.export.JMEExporter ex)
           
 
Methods inherited from class com.jme.scene.TriMesh
clearBuffers, draw, findCollisions, findTriangleCollision, findTrianglePick, getIndexBuffer, getMaxIndex, getMeshAsTriangles, getMeshAsTrianglesVertices, getMode, getTriangle, getTriangle, getTriangleCount, getTriangleIndices, getVertIndex, hasCollision, hasTriangleCollision, randomPointOnTriangles, recalcTriangleQuantity, reconstruct, setIndexBuffer, setMode, setTriangleQuantity
 
Methods inherited from class com.jme.scene.Geometry
addTextureCoordinates, addTextureCoordinates, applyRenderState, checkTextureCoordinates, clearTextureBuffers, copyTextureCoordinates, findPick, getBinormalBuffer, getColorBuffer, getDefaultColor, getDisplayListID, getFogBuffer, getLightState, getModelBound, getNormalBuffer, getNumberOfUnits, getTangentBuffer, getTextureCoords, getTextureCoords, getVBOInfo, getVertexBuffer, getVertexCount, getWorldCoords, getWorldNormals, hasDirtyVertices, isCastsShadows, lockMeshes, postdraw, predraw, randomVertex, reconstruct, resizeTextureIds, rotateNormals, rotatePoints, scaleTextureCoordinates, scaleTextureCoordinates, setBinormalBuffer, setCastsShadows, setColorBuffer, setDefaultColor, setDisplayListID, setFogCoordBuffer, setHasDirtyVertices, setLightState, setModelBound, setNormalBuffer, setRandomColors, setSolidColor, setTangentBuffer, setTextureCoords, setTextureCoords, setTextureCoords, setVBOInfo, setVertexBuffer, setVertexCount, sortLights, translatePoints, translatePoints, unlockMeshes, updateModelBound, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getController, getControllerCount, getControllers, getCullHint, getLastFrustumIntersection, getLightCombineMode, getLocalCullHint, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalRotation, getLocalScale, getLocalTextureCombineMode, getLocalToWorldMatrix, getLocalTranslation, getLocks, getName, getNormalsMode, getParent, getRenderQueueMode, getRenderState, getRenderState, getTextureCombineMode, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, hasAncestor, isCollidable, localToWorld, lock, lock, lockBounds, lockBranch, lockMeshes, lockShadows, lockTransforms, lookAt, onDraw, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeController, removeFromParent, removeUserData, rotateUpTo, setCullHint, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setLocalTranslation, setLocks, setLocks, setName, setNormalsMode, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setUserData, setZOrder, setZOrder, toString, unlock, unlock, unlockBounds, unlockBranch, unlockMeshes, unlockShadows, unlockTransforms, updateGeometricState, updateRenderState, updateRenderState, updateWorldData, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, updateWorldVectors, worldToLocal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mesh

public Mesh()
Constructor of Mesh.


Mesh

public Mesh(java.lang.String texture,
            IVertex[] vertices,
            ITriangle[] triangles,
            IWeight[] weights,
            int anisotropic,
            com.jme.image.Texture.MinificationFilter miniFilter,
            com.jme.image.Texture.MagnificationFilter magFilter,
            boolean orientedBounding)
Constructor of Mesh.

Parameters:
texture - The String texture file name without extension.
vertices - The array of IVertex in this mesh.
triangles - The array of ITriangle in this mesh.
weights - The array of IWeight in this mesh.
Method Detail

initialize

public void initialize(java.lang.String name)
Description copied from interface: IMesh
Initialize this mesh and its geometric data.

Specified by:
initialize in interface IMesh
Parameters:
name - The parent MD5 node String name.

updateMesh

public void updateMesh()
Description copied from interface: IMesh
Update this mesh and its geometric data.

Specified by:
updateMesh in interface IMesh

swapBuffer

public void swapBuffer()
Description copied from interface: IMesh
Swap the vertex information buffers.

Specified by:
swapBuffer in interface IMesh

setJoints

public void setJoints(IJoint[] joints)
Description copied from interface: IMesh
Set this mesh to use the given joints.

Specified by:
setJoints in interface IMesh
Parameters:
joints - The array of IJoint to be used.

setExtension

public static void setExtension(java.lang.String extension)
Set the texture extension to use.

Parameters:
extension - The String extension.

getVertex

public IVertex getVertex(int index)
Description copied from interface: IMesh
Retrieve the vertex with given index number.

Specified by:
getVertex in interface IMesh
Parameters:
index - The Integer index number of the IVertex.
Returns:
The IVertex instance with given index number.

getWeight

public IWeight getWeight(int index)
Description copied from interface: IMesh
Retrieve the weight with given index number.

Specified by:
getWeight in interface IMesh
Parameters:
index - The Integer index number of the Weight.
Returns:
The Weight instance with given index number.

getClassTag

public java.lang.Class getClassTag()
Specified by:
getClassTag in interface com.jme.util.export.Savable
Overrides:
getClassTag in class com.jme.scene.Spatial

write

public void write(com.jme.util.export.JMEExporter ex)
           throws java.io.IOException
Specified by:
write in interface com.jme.util.export.Savable
Overrides:
write in class com.jme.scene.TriMesh
Throws:
java.io.IOException

read

public void read(com.jme.util.export.JMEImporter im)
          throws java.io.IOException
Specified by:
read in interface com.jme.util.export.Savable
Overrides:
read in class com.jme.scene.TriMesh
Throws:
java.io.IOException

clone

public IMesh clone(IJoint[] clonedJoints)
Description copied from interface: IMesh
Clone this mesh.

Specified by:
clone in interface IMesh
Parameters:
clonedJoints - The array of cloned IJoint.
Returns:
The cloned copy of this IMesh