|
||||||||||
| 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.Node
com.jmex.physics.PhysicsNode
public abstract class PhysicsNode
A PhysicsNode defines a physical entity. Its children may be graphical and physical scenegraph Spatial. The graphical
Spatials are used for visual representation and may be used for automatic computation of physical representation
(see generatePhysicsGeometry(), PhysicsCollisionGeometry). The physical Spatials define the collision
bounds for the physics simulation. Advanced implementation may even use them for mass distribution of dynamic nodes.
PhysicsSpace.createDynamicNode() and
PhysicsSpace.createStaticNode()).
generatePhysicsGeometry(),
DynamicPhysicsNode,
StaticPhysicsNode,
PhysicsCollisionGeometry,
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 | |
|---|---|
static java.lang.String |
MATERIAL_PROPERTY
|
| Fields inherited from class com.jme.scene.Node |
|---|
children |
| 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 |
| Method Summary | |
|---|---|
PhysicsBox |
createBox(java.lang.String name)
Create a physics box. |
PhysicsCapsule |
createCapsule(java.lang.String name)
Create a physics capsule. |
PhysicsCylinder |
createCylinder(java.lang.String name)
Create a physics cylinder. |
PhysicsMesh |
createMesh(java.lang.String name)
Create a physics mesh. |
PhysicsRay |
createRay(java.lang.String name)
Create a physics ray. |
PhysicsSphere |
createSphere(java.lang.String name)
Create a physics sphere. |
void |
delete()
|
protected void |
drawDebugInfo(com.jme.renderer.Renderer renderer)
Draw information about the physical properties of the Node. |
void |
generatePhysicsGeometry()
This method generates physics geometry bounds for detecting collision from the graphical representation in this PhysicsNode. |
void |
generatePhysicsGeometry(boolean useTriangleAccurateGeometries)
This method generates physics geometry bounds for detecting collision from the graphical representation in this PhysicsNode. |
static void |
generatePhysicsGeometry(com.jme.scene.Node source,
PhysicsNode target,
boolean useTriangleAccurateGeometries)
This method generates physics geometry bounds for detecting collision from the graphical representation in this PhysicsNode. |
static void |
generatePhysicsGeometry(com.jme.scene.Node source,
PhysicsNode target,
boolean useTriangleAccurateGeometries,
java.util.Map<com.jme.scene.Spatial,PhysicsCollisionGeometry> collisionGeometryMap)
This method generates physics geometry bounds for detecting collision from the graphical representation in this PhysicsNode. |
java.lang.Class |
getClassTag()
|
com.jme.input.util.SyntheticButton |
getCollisionEventHandler()
Creates a synthetic button that is triggered when this node collides with another node. |
CollisionGroup |
getCollisionGroup()
|
Material |
getMaterial()
Query default material of this node. |
PhysicsNode |
getPhysicsNode()
|
abstract PhysicsSpace |
getSpace()
|
boolean |
isActive()
|
abstract boolean |
isResting()
|
abstract boolean |
isStatic()
|
void |
read(com.jme.util.export.JMEImporter im)
|
boolean |
setActive(boolean value)
Activate the node when added to a space. |
void |
setCollisionGroup(CollisionGroup value)
|
void |
setMaterial(Material value)
Change material of this node. |
protected void |
setParent(com.jme.scene.Node parent)
overridden to check we don't get another PhysicsNode as parent. |
void |
write(com.jme.util.export.JMEExporter ex)
|
| Methods inherited from class com.jme.scene.Node |
|---|
applyRenderState, attachChild, attachChildAt, childChange, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, findCollisions, findPick, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, hasCollision, lockBounds, lockMeshes, lockShadows, lockTransforms, setModelBound, sortLights, swapChildren, unlockBounds, unlockMeshes, unlockShadows, unlockTransforms, updateModelBound, updateWorldBound, updateWorldData, updateWorldVectors |
| 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, lockBranch, lockMeshes, 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, toString, unlock, unlock, unlockBranch, unlockMeshes, updateGeometricState, updateRenderState, updateRenderState, updateWorldRotation, updateWorldScale, updateWorldTranslation, 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 MATERIAL_PROPERTY
| Method Detail |
|---|
public abstract PhysicsSpace getSpace()
public abstract boolean isStatic()
public void generatePhysicsGeometry()
java.lang.IllegalStateException - if no graphical representation is present (no Geometries within this Node)PhysicsCollisionGeometrypublic void generatePhysicsGeometry(boolean useTriangleAccurateGeometries)
useTriangleAccurateGeometries - true to use triangle accuracy for collision detection with arbitrary
geometries - use with care! (makes it expensive to compute collisions)
java.lang.IllegalStateException - if no graphical representation is present (no Geometries within this Node)PhysicsCollisionGeometry
public static void generatePhysicsGeometry(com.jme.scene.Node source,
PhysicsNode target,
boolean useTriangleAccurateGeometries)
source - The Node whose children are traversed to create corresponding collision geometriestarget - The PhysicsNode to which the collision geometries are added. Can be the same object as source.useTriangleAccurateGeometries - true to use triangle accuracy for collision detection with arbitrary
geometries - use with care! (makes it expensive to compute collisions)
java.lang.IllegalStateException - if no graphical representation is present (no Geometries within this Node)PhysicsCollisionGeometry
public static void generatePhysicsGeometry(com.jme.scene.Node source,
PhysicsNode target,
boolean useTriangleAccurateGeometries,
java.util.Map<com.jme.scene.Spatial,PhysicsCollisionGeometry> collisionGeometryMap)
source - The Node whose children are traversed to create corresponding collision geometriestarget - The PhysicsNode to which the collision geometries are added. Can be the same object as source.useTriangleAccurateGeometries - true to use triangle accuracy for collision detection with arbitrary
geometries - use with care! (makes it expensive to compute collisions)collisionGeometryMap - If a map is passed, each spatial for which a collision geometry is generated
will be put into it with the collision geometry as value. Also, Spatials already inside the map won't have
any collision geometry generated. Pass null to avoid this.
java.lang.IllegalStateException - if no graphical representation is present (no Geometries within this Node)PhysicsCollisionGeometryprotected void setParent(com.jme.scene.Node parent)
setParent in class com.jme.scene.Spatialparent - new ParentSpatial.setParent(com.jme.scene.Node)protected void drawDebugInfo(com.jme.renderer.Renderer renderer)
renderer - where to draw topublic PhysicsSphere createSphere(java.lang.String name)
name - name of the Spatial
PhysicsCollisionGeometry,
PhysicsSpherepublic PhysicsBox createBox(java.lang.String name)
name - name of the Spatial
PhysicsCollisionGeometry,
PhysicsBoxpublic PhysicsCylinder createCylinder(java.lang.String name)
name - name of the Spatial
PhysicsCollisionGeometry,
PhysicsCylinderpublic PhysicsCapsule createCapsule(java.lang.String name)
name - name of the Spatial
PhysicsCollisionGeometry,
PhysicsCapsulepublic PhysicsMesh createMesh(java.lang.String name)
name - name of the Spatial
PhysicsCollisionGeometry,
PhysicsMeshpublic PhysicsRay createRay(java.lang.String name)
name - name of the Spatial
PhysicsCollisionGeometry,
PhysicsRaypublic final boolean isActive()
public boolean setActive(boolean value)
value - true when activated
public Material getMaterial()
PhysicsCollisionGeometry.getMaterial()public void setMaterial(Material value)
value - new materialPhysicsCollisionGeometry.setMaterial(com.jmex.physics.material.Material)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 delete()
public abstract boolean isResting()
DynamicPhysicsNode.rest() method. For static nodes this return true, always.DynamicPhysicsNode.rest()public final PhysicsNode getPhysicsNode()
getPhysicsNode in interface PhysicsSpatialpublic java.lang.Class getClassTag()
getClassTag in interface com.jme.util.export.SavablegetClassTag in class com.jme.scene.Spatial
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.Nodejava.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.Nodejava.io.IOExceptionpublic CollisionGroup getCollisionGroup()
public void setCollisionGroup(CollisionGroup value)
value - new value for field collisionGroupCollisionGroup
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||