com.jmex.physics.geometry
Class PhysicsMesh

java.lang.Object
  extended by com.jme.scene.Spatial
      extended by com.jmex.physics.PhysicsCollisionGeometry
          extended by com.jmex.physics.geometry.PhysicsMesh
All Implemented Interfaces:
com.jme.util.export.Savable, PhysicsSpatial, java.io.Serializable

public abstract class PhysicsMesh
extends PhysicsCollisionGeometry

A PhysicsMesh can represent any triangle soup that is used a collision geometry.

Author:
Irrisor
See Also:
copyFrom(com.jme.scene.TriMesh), Serialized Form

Nested Class Summary
 
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.jmex.physics.PhysicsCollisionGeometry
MATERIAL_PROPERTY, PHYSICS_NODE_PROPERTY
 
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
protected PhysicsMesh(PhysicsNode node)
           
 
Method Summary
abstract  void copyFrom(com.jme.scene.TriMesh triMesh)
          Copy data from a scene TriMesh to the collision info.
abstract  void copyFrom(com.jme.scene.TriMesh triMesh, float volume, com.jme.math.Vector3f centerOfMass, com.jme.math.Matrix3f inertia)
          Copy data from a scene TriMesh to the collision info.
 java.lang.Class getClassTag()
           
 void write(com.jme.util.export.JMEExporter ex)
           
 
Methods inherited from class com.jmex.physics.PhysicsCollisionGeometry
draw, drawDebugShape, findCollisions, findPick, getCollisionEventHandler, getMaterial, getPhysicsNode, getTriangleCount, getVertexCount, getVolume, hasCollision, read, readPhysicsNodeFromInputCapsule, setMaterial, setModelBound, setNode, setParent, updateModelBound, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, applyRenderState, 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, 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, setRenderQueueMode, setRenderState, setTextureCombineMode, setUserData, setZOrder, setZOrder, sortLights, toString, unlock, unlock, unlockBounds, unlockBranch, unlockMeshes, 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

PhysicsMesh

protected PhysicsMesh(PhysicsNode node)
Method Detail

copyFrom

public abstract void copyFrom(com.jme.scene.TriMesh triMesh)
Copy data from a scene TriMesh to the collision info. The implementation may hold a reference to the specified TriMesh data but usually will not update the collision info automatically. If this PhysicsMesh belongs to a DynamicPhysicsNode volume, center of mass and inertia are automatically computed. To avoid this computation use copyFrom(TriMesh, float, Vector3f, Matrix3f)

Parameters:
triMesh - where to copy triangle data from
See Also:
copyFrom(TriMesh, float, Vector3f, Matrix3f)

copyFrom

public abstract void copyFrom(com.jme.scene.TriMesh triMesh,
                              float volume,
                              com.jme.math.Vector3f centerOfMass,
                              com.jme.math.Matrix3f inertia)
Copy data from a scene TriMesh to the collision info. The implementation may hold a reference to the specified TriMesh data but usually will not update the collision info automatically.

Parameters:
triMesh - where to copy triangle data from
volume - volume of the trimesh (see PhysicsCollisionGeometry.getVolume())
centerOfMass - center of mass for this trimesh
inertia - inertia matrix for the dynamic behaviour of the geometry

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 PhysicsCollisionGeometry
Throws:
java.io.IOException