Package com.jme3.bullet.control
Class KinematicRagdollControl
java.lang.Object
com.jme3.bullet.control.AbstractPhysicsControl
com.jme3.bullet.control.KinematicRagdollControl
- All Implemented Interfaces:
- PhysicsCollisionListener,- PhysicsControl,- Savable,- Control,- JmeCloneable,- Cloneable
@Deprecated
public class KinematicRagdollControl
extends AbstractPhysicsControl
implements PhysicsCollisionListener, JmeCloneable
Deprecated.
This control is still a WIP, use it at your own risk
To use this control you need a model with an AnimControl and a SkeletonControl.
This should be the case if you imported an animated model from Ogre or blender.
Note enabling/disabling the control add/removes it from the physics space
 
To use this control you need a model with an AnimControl and a SkeletonControl.
This should be the case if you imported an animated model from Ogre or blender.
Note enabling/disabling the control add/removes it from the physics space
This control creates collision shapes for all bones in the skeleton when you invoke spatial.addControl(ragdollControl).
- The shape is HullCollision shape based on the vertices associated with each bone and based on a tweakable weight threshold (see setWeightThreshold)
- If you
 don't want each bone to be a collision shape, you can specify what bone to
 use by using the addBoneName method
 By using this method, bone that are not used to create a shape, are "merged" to their parent to create the collision shape.
There are 2 modes for this control :
- The kinematic modes
 :
 this is the default behavior, this means that the collision shapes of the body are able to interact with physics enabled objects. in this mode physics shapes follow the motion of the animated skeleton (for example animated by a key framed animation) this mode is enabled by calling setKinematicMode();
- The ragdoll modes:
 To enable this behavior, you need to invoke the setRagdollMode() method. In this mode the character is entirely controlled by physics, so it will fall under the gravity and move if any force is applied to it.
This class is shared between JBullet and Native Bullet.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumDeprecated.Enumerate joint-control modes for this control.classDeprecated.Link a bone to a jointed rigid body.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final PhysicsRigidBodyDeprecated.protected booleanDeprecated.protected floatDeprecated.protected floatDeprecated.blending interval for animations (in seconds, ≥0)protected final Map<String,KinematicRagdollControl.PhysicsBoneLink> Deprecated.Deprecated.protected booleanDeprecated.protected floatDeprecated.protected Vector3fDeprecated.protected List<RagdollCollisionListener>Deprecated.protected static final LoggerDeprecated.list of registered collision listenersprotected KinematicRagdollControl.ModeDeprecated.protected final Vector3fDeprecated.protected final QuaternionDeprecated.protected RagdollPresetDeprecated.protected floatDeprecated.protected SkeletonDeprecated.skeleton being controlledprotected SpatialDeprecated.model being controlledprotected floatDeprecated.accumulate total mass of ragdoll when control is added to a sceneprotected floatDeprecated.Fields inherited from class com.jme3.bullet.control.AbstractPhysicsControladded, applyLocal, enabled, space, spatial
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.Instantiate an enabled control.KinematicRagdollControl(float weightThreshold) Deprecated.Instantiate an enabled control with the specified weight threshold.KinematicRagdollControl(RagdollPreset preset) Deprecated.Instantiate an enabled control with the specified preset.KinematicRagdollControl(RagdollPreset preset, float weightThreshold) Deprecated.Instantiate an enabled control with the specified preset and weight threshold.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBoneName(String name) Deprecated.Add a bone name to this control.voidaddCollisionListener(RagdollCollisionListener listener) Deprecated.Add a collision listener to this control.protected voidaddPhysics(PhysicsSpace space) Deprecated.Add all managed physics objects to the specified space.voidDeprecated.Ensure that user control is enabled for any bones used by inverse kinematics and disabled for any other bones.voidblendToKinematicMode(float blendTime) Deprecated.Smoothly blend from Ragdoll mode to Kinematic mode This is useful to blend ragdoll actual position to a keyframe animation for exampleprotected voidboneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int recursionCount, Map<Integer, List<Float>> pointsMap) Deprecated.Generate a physics shape and bone links for the specified bone.voidcollision(PhysicsCollisionEvent event) Deprecated.For internal use only: callback for collision eventprotected voidcreateSpatialData(Spatial model) Deprecated.Create spatial-dependent data.Deprecated.Access the named bone.getBoneRigidBody(String boneName) Deprecated.Access the rigidBody associated with the named bone.floatDeprecated.Read the ragdoll's event-dispatch impulse threshold.floatDeprecated.Read the rotation speed for inverse kinematics.floatDeprecated.Read the distance threshold for inverse kinematics.Deprecated.Return the joint between the specified bone and its parent.floatDeprecated.Read the limb damping.getMode()Deprecated.returns the mode of this controlfloatDeprecated.Read the ragdoll's total mass.floatDeprecated.Read the ragdoll's weight threshold.jmeClone()Deprecated.Create a shallow clone for the JME cloner.protected voidkinematicUpdate(float tpf) Deprecated.Update this control in Kinematic mode, based on bone animation tracks.protected voidmatchPhysicObjectToBone(KinematicRagdollControl.PhysicsBoneLink link, Vector3f position, Quaternion tmpRot1) Deprecated.Alter the transforms of a rigidBody to match the transforms of a bone.protected voidragDollUpdate(float tpf) Deprecated.Update this control in Ragdoll mode, based on Bullet physics.voidread(JmeImporter im) Deprecated.De-serialize this control, for example when loading from a J3O file.voidreBuild()Deprecated.Rebuild the ragdoll.voidDeprecated.Remove all inverse-kinematics targets.voidremoveIKTarget(Bone bone) Deprecated.Remove the inverse-kinematics target for the specified bone.protected voidremovePhysics(PhysicsSpace space) Deprecated.Remove all managed physics objects from the specified space.protected voidremoveSpatialData(Spatial spat) Deprecated.Destroy spatial-dependent data.voidrender(RenderManager rm, ViewPort vp) Deprecated.Render this control.protected voidscanSpatial(Spatial model) Deprecated.Generate physics shapes and bone links for the skeleton.voidsetCcdMotionThreshold(float value) Deprecated.Alter the CcdMotionThreshold of all rigid bodies in the ragdoll.voidsetCcdSweptSphereRadius(float value) Deprecated.Alter the CcdSweptSphereRadius of all rigid bodies in the ragdoll.voidsetEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold) Deprecated.Alter the ragdoll's event-dispatch impulse threshold.voidDeprecated.Sets the control into Inverse Kinematics mode.voidsetIkRotSpeed(float ikRotSpeed) Deprecated.Alter the rotation speed for inverse kinematics.setIKTarget(Bone bone, Vector3f worldPos, int chainLength) Deprecated.Add a target for inverse kinematics.voidsetIKThreshold(float IKThreshold) Deprecated.Alter the distance threshold for inverse kinematics.voidsetJointLimit(String boneName, float maxX, float minX, float maxY, float minY, float maxZ, float minZ) Deprecated.Alter the limits of the joint connecting the specified bone to its parent.voidDeprecated.Put the control into Kinematic mode.voidsetLimbDampening(float limbDampening) Deprecated.Alter the limb damping.protected voidDeprecated.Enable or disable the ragdoll behaviour.protected voidDeprecated.Translate the physics object to the specified location.protected voidsetPhysicsRotation(Quaternion quat) Deprecated.Rotate the physics object to the specified orientation.voidDeprecated.Sets the control into Ragdoll mode The skeleton is entirely controlled by physics.voidsetRootMass(float rootMass) Deprecated.Alter the ragdoll's root mass.voidsetWeightThreshold(float weightThreshold) Deprecated.Alter the ragdoll's weight threshold.voidupdate(float tpf) Deprecated.Update this control.voidupdateBone(KinematicRagdollControl.PhysicsBoneLink link, float tpf, TempVars vars, Quaternion tmpRot1, Quaternion[] tmpRot2, Bone tipBone, Vector3f target, int depth, int maxDepth) Deprecated.Update a bone and its ancestors in IK mode.voidwrite(JmeExporter ex) Deprecated.Serialize this control, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.control.AbstractPhysicsControlapplyPhysicsTransform, cloneFields, cloneForSpatial, getPhysicsSpace, getSpatial, getSpatialRotation, getSpatialTranslation, isApplyPhysicsLocal, isEnabled, setApplyPhysicsLocal, setEnabled, setPhysicsSpace, setSpatialMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.util.clone.JmeCloneablecloneFields
- 
Field Details- 
loggerDeprecated.list of registered collision listeners
- 
listenersDeprecated.
- 
boneListDeprecated.
- 
boneLinksDeprecated.
- 
modelPositionDeprecated.
- 
modelRotationDeprecated.
- 
baseRigidBodyDeprecated.
- 
targetModelDeprecated.model being controlled
- 
skeletonDeprecated.skeleton being controlled
- 
presetDeprecated.
- 
initScaleDeprecated.
- 
modeDeprecated.
- 
debugprotected boolean debugDeprecated.
- 
blendedControlprotected boolean blendedControlDeprecated.
- 
weightThresholdprotected float weightThresholdDeprecated.
- 
blendStartprotected float blendStartDeprecated.
- 
blendTimeprotected float blendTimeDeprecated.blending interval for animations (in seconds, ≥0)
- 
eventDispatchImpulseThresholdprotected float eventDispatchImpulseThresholdDeprecated.
- 
rootMassprotected float rootMassDeprecated.
- 
totalMassprotected float totalMassDeprecated.accumulate total mass of ragdoll when control is added to a scene
 
- 
- 
Constructor Details- 
KinematicRagdollControlpublic KinematicRagdollControl()Deprecated.Instantiate an enabled control.
- 
KinematicRagdollControlpublic KinematicRagdollControl(float weightThreshold) Deprecated.Instantiate an enabled control with the specified weight threshold.- Parameters:
- weightThreshold- (>0, <1)
 
- 
KinematicRagdollControlDeprecated.Instantiate an enabled control with the specified preset and weight threshold.- Parameters:
- preset- (not null)
- weightThreshold- (>0, <1)
 
- 
KinematicRagdollControlDeprecated.Instantiate an enabled control with the specified preset.- Parameters:
- preset- (not null)
 
 
- 
- 
Method Details- 
updatepublic void update(float tpf) Deprecated.Update this control. Invoked once per frame during the logical-state update, provided the control is added to a scene. Do not invoke directly from user code.- Specified by:
- updatein interface- Control
- Overrides:
- updatein class- AbstractPhysicsControl
- Parameters:
- tpf- the time interval between frames (in seconds, ≥0)
 
- 
ragDollUpdateprotected void ragDollUpdate(float tpf) Deprecated.Update this control in Ragdoll mode, based on Bullet physics.- Parameters:
- tpf- the time interval between frames (in seconds, ≥0)
 
- 
kinematicUpdateprotected void kinematicUpdate(float tpf) Deprecated.Update this control in Kinematic mode, based on bone animation tracks.- Parameters:
- tpf- the time interval between frames (in seconds, ≥0)
 
- 
updateBonepublic void updateBone(KinematicRagdollControl.PhysicsBoneLink link, float tpf, TempVars vars, Quaternion tmpRot1, Quaternion[] tmpRot2, Bone tipBone, Vector3f target, int depth, int maxDepth) Deprecated.Update a bone and its ancestors in IK mode. Note: recursive!- Parameters:
- link- the bone link for the affected bone (may be null)
- tpf- the time interval between frames (in seconds, ≥0)
- vars- unused
- tmpRot1- temporary storage used in calculations (not null)
- tmpRot2- temporary storage used in calculations (not null)
- tipBone- (not null)
- target- the location target in model space (not null, unaffected)
- depth- depth of the recursion (≥0)
- maxDepth- recursion limit (≥0)
 
- 
matchPhysicObjectToBoneprotected void matchPhysicObjectToBone(KinematicRagdollControl.PhysicsBoneLink link, Vector3f position, Quaternion tmpRot1) Deprecated.Alter the transforms of a rigidBody to match the transforms of a bone. This is used to make the ragdoll follow animated motion in Kinematic mode- Parameters:
- link- the bone link connecting the bone and the rigidBody
- position- temporary storage used in calculations (not null)
- tmpRot1- temporary storage used in calculations (not null)
 
- 
reBuildpublic void reBuild()Deprecated.Rebuild the ragdoll. This is useful if you applied scale on the ragdoll after it was initialized. Same as re-attaching.
- 
createSpatialDataDeprecated.Create spatial-dependent data. Invoked when this control is added to a scene.- Specified by:
- createSpatialDatain class- AbstractPhysicsControl
- Parameters:
- model- the controlled spatial (not null)
 
- 
removeSpatialDataDeprecated.Destroy spatial-dependent data. Invoked when this control is removed from a spatial.- Specified by:
- removeSpatialDatain class- AbstractPhysicsControl
- Parameters:
- spat- the previously controlled spatial (not null)
 
- 
addBoneNameDeprecated.Add a bone name to this control. Repeated invocations of this method can be used to specify which bones to use when generating collision shapes.Not allowed after attaching the control. - Parameters:
- name- the name of the bone to add
 
- 
scanSpatialDeprecated.Generate physics shapes and bone links for the skeleton.- Parameters:
- model- the spatial with the model's SkeletonControl (not null)
 
- 
boneRecursionprotected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int recursionCount, Map<Integer, List<Float>> pointsMap) Deprecated.Generate a physics shape and bone links for the specified bone. Note: recursive!- Parameters:
- model- the spatial with the model's SkeletonControl (not null)
- bone- the bone to be linked (not null)
- parent- the body linked to the parent bone (not null)
- recursionCount- depth of the recursion (≥1)
- pointsMap- (not null)
 
- 
setJointLimitpublic void setJointLimit(String boneName, float maxX, float minX, float maxY, float minY, float maxZ, float minZ) Deprecated.Alter the limits of the joint connecting the specified bone to its parent. Can only be invoked after adding the control to a spatial.- Parameters:
- boneName- the name of the bone
- maxX- the maximum rotation on the X axis (in radians)
- minX- the minimum rotation on the X axis (in radians)
- maxY- the maximum rotation on the Y axis (in radians)
- minY- the minimum rotation on the Y axis (in radians)
- maxZ- the maximum rotation on the Z axis (in radians)
- minZ- the minimum rotation on the Z axis (in radians)
 
- 
getJointDeprecated.Return the joint between the specified bone and its parent. This return null if it's invoked before adding the control to a spatial- Parameters:
- boneName- the name of the bone
- Returns:
- the joint between the given bone and its parent
 
- 
setPhysicsLocationDeprecated.Description copied from class:AbstractPhysicsControlTranslate the physics object to the specified location.- Specified by:
- setPhysicsLocationin class- AbstractPhysicsControl
- Parameters:
- vec- desired location (not null, unaffected)
 
- 
setPhysicsRotationDeprecated.Description copied from class:AbstractPhysicsControlRotate the physics object to the specified orientation.- Specified by:
- setPhysicsRotationin class- AbstractPhysicsControl
- Parameters:
- quat- desired orientation (not null, unaffected)
 
- 
addPhysicsDeprecated.Description copied from class:AbstractPhysicsControlAdd all managed physics objects to the specified space.- Specified by:
- addPhysicsin class- AbstractPhysicsControl
- Parameters:
- space- which physics space to add to (not null)
 
- 
removePhysicsDeprecated.Description copied from class:AbstractPhysicsControlRemove all managed physics objects from the specified space.- Specified by:
- removePhysicsin class- AbstractPhysicsControl
- Parameters:
- space- which physics space to remove from (not null)
 
- 
collisionDeprecated.For internal use only: callback for collision event- Specified by:
- collisionin interface- PhysicsCollisionListener
- Parameters:
- event- (not null)
 
- 
setModeDeprecated.Enable or disable the ragdoll behaviour. if ragdollEnabled is true, the character motion will only be powered by physics else, the character will be animated by the keyframe animation, but will be able to physically interact with its physics environment- Parameters:
- mode- an enum value (not null)
 
- 
blendToKinematicModepublic void blendToKinematicMode(float blendTime) Deprecated.Smoothly blend from Ragdoll mode to Kinematic mode This is useful to blend ragdoll actual position to a keyframe animation for example- Parameters:
- blendTime- the blending time between ragdoll to anim.
 
- 
setKinematicModepublic void setKinematicMode()Deprecated.Put the control into Kinematic mode. In this mode, the collision shapes follow the movements of the skeleton while interacting with the physics environment.
- 
setRagdollModepublic void setRagdollMode()Deprecated.Sets the control into Ragdoll mode The skeleton is entirely controlled by physics.
- 
setIKModepublic void setIKMode()Deprecated.Sets the control into Inverse Kinematics mode. The affected bones are affected by IK. physics.
- 
getModeDeprecated.returns the mode of this control- Returns:
- an enum value
 
- 
addCollisionListenerDeprecated.Add a collision listener to this control.- Parameters:
- listener- (not null, alias created)
 
- 
setRootMasspublic void setRootMass(float rootMass) Deprecated.Alter the ragdoll's root mass.- Parameters:
- rootMass- the desired mass (≥0)
 
- 
getTotalMasspublic float getTotalMass()Deprecated.Read the ragdoll's total mass.- Returns:
- mass (≥0)
 
- 
getWeightThresholdpublic float getWeightThreshold()Deprecated.Read the ragdoll's weight threshold.- Returns:
- threshold
 
- 
setWeightThresholdpublic void setWeightThreshold(float weightThreshold) Deprecated.Alter the ragdoll's weight threshold.- Parameters:
- weightThreshold- the desired threshold
 
- 
getEventDispatchImpulseThresholdpublic float getEventDispatchImpulseThreshold()Deprecated.Read the ragdoll's event-dispatch impulse threshold.- Returns:
- threshold
 
- 
setEventDispatchImpulseThresholdpublic void setEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold) Deprecated.Alter the ragdoll's event-dispatch impulse threshold.- Parameters:
- eventDispatchImpulseThreshold- desired threshold
 
- 
setCcdMotionThresholdpublic void setCcdMotionThreshold(float value) Deprecated.Alter the CcdMotionThreshold of all rigid bodies in the ragdoll.- Parameters:
- value- the desired threshold value (velocity, >0) or zero to disable CCD (default=0)
- See Also:
 
- 
setCcdSweptSphereRadiuspublic void setCcdSweptSphereRadius(float value) Deprecated.Alter the CcdSweptSphereRadius of all rigid bodies in the ragdoll.- Parameters:
- value- the desired radius of the sphere used for continuous collision detection (≥0)
- See Also:
 
- 
getBoneRigidBodyDeprecated.Access the rigidBody associated with the named bone.- Parameters:
- boneName- the name of the bone
- Returns:
- the associated rigidBody.
 
- 
renderDeprecated.Render this control. Invoked once per view port per frame, provided the control is added to a scene. Should be invoked only by a subclass or by the RenderManager.- Specified by:
- renderin interface- Control
- Overrides:
- renderin class- AbstractPhysicsControl
- Parameters:
- rm- the render manager (not null)
- vp- the view port to render (not null)
 
- 
jmeCloneDeprecated.Create a shallow clone for the JME cloner.- Specified by:
- jmeClonein interface- JmeCloneable
- Returns:
- a new control (not null)
 
- 
setIKTargetDeprecated.Add a target for inverse kinematics.- Parameters:
- bone- which bone the IK applies to (not null)
- worldPos- the world coordinates of the goal (not null)
- chainLength- number of bones in the chain
- Returns:
- a new instance (not null, already added to ikTargets)
 
- 
removeIKTargetDeprecated.Remove the inverse-kinematics target for the specified bone.- Parameters:
- bone- which bone has the target (not null, modified)
 
- 
removeAllIKTargetspublic void removeAllIKTargets()Deprecated.Remove all inverse-kinematics targets.
- 
applyUserControlpublic void applyUserControl()Deprecated.Ensure that user control is enabled for any bones used by inverse kinematics and disabled for any other bones.
- 
getIkRotSpeedpublic float getIkRotSpeed()Deprecated.Read the rotation speed for inverse kinematics.- Returns:
- speed (≥0)
 
- 
setIkRotSpeedpublic void setIkRotSpeed(float ikRotSpeed) Deprecated.Alter the rotation speed for inverse kinematics.- Parameters:
- ikRotSpeed- the desired speed (≥0, default=7)
 
- 
getIKThresholdpublic float getIKThreshold()Deprecated.Read the distance threshold for inverse kinematics.- Returns:
- distance threshold
 
- 
setIKThresholdpublic void setIKThreshold(float IKThreshold) Deprecated.Alter the distance threshold for inverse kinematics.- Parameters:
- IKThreshold- the desired distance threshold (default=0.1)
 
- 
getLimbDampeningpublic float getLimbDampening()Deprecated.Read the limb damping.- Returns:
- the viscous damping ratio (0→no damping, 1→critically damped)
 
- 
setLimbDampeningpublic void setLimbDampening(float limbDampening) Deprecated.Alter the limb damping.- Parameters:
- limbDampening- the desired viscous damping ratio (0→no damping, 1→critically damped, default=0.6)
 
- 
getBoneDeprecated.Access the named bone.- Parameters:
- name- which bone to access
- Returns:
- the pre-existing instance, or null if not found
 
- 
writeDeprecated.Serialize this control, for example when saving to a J3O file.- Specified by:
- writein interface- Savable
- Overrides:
- writein class- AbstractPhysicsControl
- Parameters:
- ex- exporter (not null)
- Throws:
- IOException- from exporter
 
- 
readDeprecated.De-serialize this control, for example when loading from a J3O file.- Specified by:
- readin interface- Savable
- Overrides:
- readin class- AbstractPhysicsControl
- Parameters:
- im- importer (not null)
- Throws:
- IOException- from importer
 
 
-