|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jmex.physics.PhysicsCollisionGeometry
public abstract class PhysicsCollisionGeometry
Subclasses of this class are used to specify the physical geometry of a PhysicsNode. The physical geometry
defines the collision bounds for the physics simulation. Advanced implementation may even use them for mass
distribution of dynamic nodes.
PhysicsNode.
TODO: Cylinder, Cone, Capsule, TriMesh, Plane?, Ray?
| 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 | |
|---|---|
static java.lang.String |
MATERIAL_PROPERTY
|
static java.lang.String |
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 |
PhysicsCollisionGeometry(PhysicsNode node)
|
protected |
PhysicsCollisionGeometry(PhysicsNode node,
java.lang.String name)
|
| Method Summary | |
|---|---|
void |
draw(com.jme.renderer.Renderer r)
|
protected abstract void |
drawDebugShape(PhysicsNode physicsNode,
com.jme.renderer.Renderer renderer)
Draw a visual representation of this physical collision bound. |
void |
findCollisions(com.jme.scene.Spatial scene,
com.jme.intersection.CollisionResults results)
|
void |
findPick(com.jme.math.Ray toTest,
com.jme.intersection.PickResults results)
|
com.jme.input.util.SyntheticButton |
getCollisionEventHandler()
Creates a synthetic button that is triggered when this node collides with another node. |
Material |
getMaterial()
Query material of this geometry. |
PhysicsNode |
getPhysicsNode()
|
int |
getTriangleCount()
|
int |
getVertexCount()
|
abstract float |
getVolume()
Query the volume of this geometry. |
boolean |
hasCollision(com.jme.scene.Spatial scene,
boolean checkTriangles)
|
void |
read(com.jme.util.export.JMEImporter im)
|
static PhysicsNode |
readPhysicsNodeFromInputCapsule(com.jme.util.export.InputCapsule inputCapsule)
|
void |
setMaterial(Material value)
Change material of this geometry. |
void |
setModelBound(com.jme.bounding.BoundingVolume modelBound)
|
protected void |
setNode(PhysicsNode node)
Allow to change the associated node by the implementation |
protected void |
setParent(com.jme.scene.Node parent)
Allow only PhysicsNodes as parent. |
void |
updateModelBound()
|
void |
updateWorldBound()
|
void |
write(com.jme.util.export.JMEExporter ex)
|
| Methods inherited from class com.jme.scene.Spatial |
|---|
addController, applyRenderState, calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getClassTag, 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 |
| Field Detail |
|---|
public static final java.lang.String PHYSICS_NODE_PROPERTY
public static final java.lang.String MATERIAL_PROPERTY
| Constructor Detail |
|---|
protected PhysicsCollisionGeometry(PhysicsNode node,
java.lang.String name)
protected PhysicsCollisionGeometry(PhysicsNode node)
| Method Detail |
|---|
public void draw(com.jme.renderer.Renderer r)
draw in class com.jme.scene.Spatialpublic int getTriangleCount()
getTriangleCount in class com.jme.scene.Spatialpublic int getVertexCount()
getVertexCount in class com.jme.scene.Spatialprotected void setNode(PhysicsNode node)
node - new phyiscs node of this geometry
public void read(com.jme.util.export.JMEImporter im)
throws java.io.IOException
read in interface com.jme.util.export.Savableread in class com.jme.scene.Spatialjava.io.IOException
public void write(com.jme.util.export.JMEExporter ex)
throws java.io.IOException
write in interface com.jme.util.export.Savablewrite in class com.jme.scene.Spatialjava.io.IOException
public static PhysicsNode readPhysicsNodeFromInputCapsule(com.jme.util.export.InputCapsule inputCapsule)
throws java.io.IOException
java.io.IOExceptionprotected void setParent(com.jme.scene.Node parent)
setParent in class com.jme.scene.Spatialparent - new parentSpatial.setParent(com.jme.scene.Node)
protected abstract void drawDebugShape(PhysicsNode physicsNode,
com.jme.renderer.Renderer renderer)
physicsNode - node this geometry belongs torenderer - where to draw to
public void findCollisions(com.jme.scene.Spatial scene,
com.jme.intersection.CollisionResults results)
findCollisions in class com.jme.scene.Spatial
public void findPick(com.jme.math.Ray toTest,
com.jme.intersection.PickResults results)
findPick in class com.jme.scene.Spatial
public boolean hasCollision(com.jme.scene.Spatial scene,
boolean checkTriangles)
hasCollision in class com.jme.scene.Spatialpublic void updateWorldBound()
updateWorldBound in class com.jme.scene.Spatialpublic final PhysicsNode getPhysicsNode()
getPhysicsNode in interface PhysicsSpatialpublic Material getMaterial()
PhysicsNode.getMaterial()public void setMaterial(Material value)
value - new materialPhysicsNode.setMaterial(com.jmex.physics.material.Material)public abstract float getVolume()
public com.jme.input.util.SyntheticButton getCollisionEventHandler()
Note: if this event handler is obtained it must be used with an InputHandler which is updated regularly
PhysicsSpace.getCollisionEventHandler()public void updateModelBound()
updateModelBound in class com.jme.scene.Spatialpublic void setModelBound(com.jme.bounding.BoundingVolume modelBound)
setModelBound in class com.jme.scene.Spatial
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||