|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.bullet.collision.PhysicsCollisionObject
com.jme3.bullet.objects.PhysicsRigidBody
com.jme3.bullet.control.RigidBodyControl
public class RigidBodyControl
Field Summary | |
---|---|
protected boolean |
added
|
protected boolean |
enabled
|
protected boolean |
kinematicSpatial
|
protected PhysicsSpace |
space
|
protected Spatial |
spatial
|
Fields inherited from class com.jme3.bullet.objects.PhysicsRigidBody |
---|
joints, kinematic, mass, motionState |
Constructor Summary | |
---|---|
RigidBodyControl()
|
|
RigidBodyControl(CollisionShape shape)
Creates a new PhysicsNode with the supplied collision shape and mass 1 |
|
RigidBodyControl(CollisionShape shape,
float mass)
|
|
RigidBodyControl(float mass)
When using this constructor, the CollisionShape for the RigidBody is generated automatically when the Control is added to a Spatial. |
Method Summary | |
---|---|
Control |
cloneForSpatial(Spatial spatial)
Creates a clone of the Control, the given Spatial is the cloned version of the spatial to which this control is attached to. |
protected void |
createCollisionShape()
|
PhysicsSpace |
getPhysicsSpace()
|
boolean |
isApplyPhysicsLocal()
|
boolean |
isEnabled()
|
boolean |
isKinematicSpatial()
Checks if this control is in kinematic spatial mode. |
void |
read(JmeImporter im)
|
void |
render(RenderManager rm,
ViewPort vp)
Should be called prior to queuing the spatial by the RenderManager. |
void |
setApplyPhysicsLocal(boolean applyPhysicsLocal)
When set to true, the physics coordinates will be applied to the local translation of the Spatial instead of the world traslation. |
void |
setEnabled(boolean enabled)
The physics object is removed from the physics space when the control is disabled. |
void |
setKinematicSpatial(boolean kinematicSpatial)
Sets this control to kinematic spatial mode so that the spatials transform will be applied to the rigidbody in kinematic mode, defaults to true. |
void |
setPhysicsSpace(PhysicsSpace space)
|
void |
setSpatial(Spatial spatial)
|
void |
update(float tpf)
Updates the control. |
void |
write(JmeExporter ex)
|
Methods inherited from class com.jme3.bullet.collision.PhysicsCollisionObject |
---|
addCollideWithGroup, attachCollisionShape, attachDebugShape, attachDebugShape, attachDebugShape, createDebugShape, debugShape, detachDebugShape, finalize, finalizeNative, getCollideWithGroups, getCollisionGroup, getCollisionShape, getObjectId, getUserObject, initUserPointer, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObject, updateDebugShape |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Spatial spatial
protected boolean enabled
protected boolean added
protected PhysicsSpace space
protected boolean kinematicSpatial
Constructor Detail |
---|
public RigidBodyControl()
public RigidBodyControl(float mass)
mass
- When not 0, a HullCollisionShape is generated, otherwise a MeshCollisionShape is used. For geometries with box or sphere meshes the proper box or sphere collision shape is used.public RigidBodyControl(CollisionShape shape)
shape
- public RigidBodyControl(CollisionShape shape, float mass)
Method Detail |
---|
public Control cloneForSpatial(Spatial spatial)
Control
cloneForSpatial
in interface Control
public void setSpatial(Spatial spatial)
setSpatial
in interface Control
spatial
- the spatial to be controlled. This should not be called
from user code.protected void createCollisionShape()
public void setEnabled(boolean enabled)
PhysicsControl
setEnabled
in interface PhysicsControl
public boolean isEnabled()
public boolean isKinematicSpatial()
public void setKinematicSpatial(boolean kinematicSpatial)
kinematicSpatial
- public boolean isApplyPhysicsLocal()
public void setApplyPhysicsLocal(boolean applyPhysicsLocal)
applyPhysicsLocal
- public void update(float tpf)
Control
update
in interface Control
tpf
- Time per frame.public void render(RenderManager rm, ViewPort vp)
Control
render
in interface Control
public void setPhysicsSpace(PhysicsSpace space)
setPhysicsSpace
in interface PhysicsControl
public PhysicsSpace getPhysicsSpace()
getPhysicsSpace
in interface PhysicsControl
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class PhysicsRigidBody
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class PhysicsRigidBody
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |