public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl, com.jme3.util.clone.JmeCloneable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
added |
protected boolean |
enabled |
protected boolean |
kinematicSpatial |
protected PhysicsSpace |
space |
protected com.jme3.scene.Spatial |
spatial |
joints, kinematic, mass, motionStateCOLLISION_GROUP_01, COLLISION_GROUP_02, COLLISION_GROUP_03, COLLISION_GROUP_04, COLLISION_GROUP_05, COLLISION_GROUP_06, COLLISION_GROUP_07, COLLISION_GROUP_08, COLLISION_GROUP_09, COLLISION_GROUP_10, COLLISION_GROUP_11, COLLISION_GROUP_12, COLLISION_GROUP_13, COLLISION_GROUP_14, COLLISION_GROUP_15, COLLISION_GROUP_16, COLLISION_GROUP_NONE, collisionGroup, collisionGroupsMask, collisionShape, objectId| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cloneFields(com.jme3.util.clone.Cloner cloner,
java.lang.Object original) |
com.jme3.scene.control.Control |
cloneForSpatial(com.jme3.scene.Spatial spatial) |
protected void |
createCollisionShape() |
PhysicsSpace |
getPhysicsSpace() |
boolean |
isApplyPhysicsLocal() |
boolean |
isEnabled()
Returns the current enabled state of the physics control
|
boolean |
isKinematicSpatial()
Checks if this control is in kinematic spatial mode.
|
java.lang.Object |
jmeClone() |
void |
read(com.jme3.export.JmeImporter im) |
void |
render(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp) |
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 translation.
|
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)
Only used internally, do not call.
|
void |
setSpatial(com.jme3.scene.Spatial spatial) |
void |
update(float tpf) |
void |
write(com.jme3.export.JmeExporter ex) |
activate, addJoint, applyCentralForce, applyForce, applyImpulse, applyTorque, applyTorqueImpulse, clearForces, getAngularDamping, getAngularFactor, getAngularFactor, getAngularSleepingThreshold, getAngularVelocity, getAngularVelocity, getCcdMotionThreshold, getCcdSquareMotionThreshold, getCcdSweptSphereRadius, getFriction, getGravity, getGravity, getJoints, getLinearDamping, getLinearFactor, getLinearSleepingThreshold, getLinearVelocity, getLinearVelocity, getMass, getMotionState, getPhysicsLocation, getPhysicsLocation, getPhysicsRotation, getPhysicsRotation, getPhysicsRotationMatrix, getPhysicsRotationMatrix, getRestitution, isActive, isInWorld, isKinematic, postRebuild, preRebuild, rebuildRigidBody, removeJoint, setAngularDamping, setAngularFactor, setAngularFactor, setAngularSleepingThreshold, setAngularVelocity, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollisionShape, setDamping, setFriction, setGravity, setKinematic, setLinearDamping, setLinearFactor, setLinearSleepingThreshold, setLinearVelocity, setMass, setPhysicsLocation, setPhysicsRotation, setPhysicsRotation, setRestitution, setSleepingThresholdsaddCollideWithGroup, attachCollisionShape, finalize, finalizeNative, getCollideWithGroups, getCollisionGroup, getCollisionShape, getObjectId, getUserObject, initUserPointer, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObjectprotected com.jme3.scene.Spatial spatial
protected boolean enabled
protected boolean added
protected PhysicsSpace space
protected boolean kinematicSpatial
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)
public com.jme3.scene.control.Control cloneForSpatial(com.jme3.scene.Spatial spatial)
cloneForSpatial in interface com.jme3.scene.control.Controlpublic java.lang.Object jmeClone()
jmeClone in interface com.jme3.util.clone.JmeCloneablepublic void cloneFields(com.jme3.util.clone.Cloner cloner,
java.lang.Object original)
cloneFields in interface com.jme3.util.clone.JmeCloneablepublic void setSpatial(com.jme3.scene.Spatial spatial)
setSpatial in interface com.jme3.scene.control.Controlprotected void createCollisionShape()
public void setEnabled(boolean enabled)
PhysicsControlsetEnabled in interface PhysicsControlpublic boolean isEnabled()
PhysicsControlisEnabled in interface PhysicsControlpublic boolean isKinematicSpatial()
public void setKinematicSpatial(boolean kinematicSpatial)
kinematicSpatial - public boolean isApplyPhysicsLocal()
public void setApplyPhysicsLocal(boolean applyPhysicsLocal)
applyPhysicsLocal - public void update(float tpf)
update in interface com.jme3.scene.control.Controlpublic void render(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp)
render in interface com.jme3.scene.control.Controlpublic void setPhysicsSpace(PhysicsSpace space)
PhysicsControlsetPhysicsSpace in interface PhysicsControlpublic PhysicsSpace getPhysicsSpace()
getPhysicsSpace in interface PhysicsControlpublic void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savablewrite in class PhysicsRigidBodyjava.io.IOExceptionpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savableread in class PhysicsRigidBodyjava.io.IOException