Class DynamicAnimControl
- All Implemented Interfaces:
- PhysicsCollisionListener,- PhysicsControl,- PhysicsTickListener,- Savable,- Control,- JmeCloneable,- Cloneable
DacConfiguration.link(java.lang.String, float, com.jme3.bullet.animation.RangeOfMotion)
 for each bone that should have its own rigid body. Leave unlinked bones near
 the root of the skeleton to form the torso of the ragdoll.
 When you add the control to a spatial, it generates a ragdoll consisting of a rigid body for the torso and another for each linked bone. It also creates a SixDofJoint connecting each rigid body to its parent in the link hierarchy. The mass of each rigid body and the range-of-motion of each joint can be reconfigured on the fly.
Each link is either dynamic (driven by forces and torques) or kinematic (unperturbed by forces and torques). Transitions from dynamic to kinematic can be immediate or gradual.
This class is shared between JBullet and Native Bullet.
- 
Field SummaryFieldsFields inherited from class com.jme3.bullet.animation.DacConfigurationlogger2, torsoNameFields inherited from class com.jme3.bullet.control.AbstractPhysicsControladded, applyLocal, enabled, space, spatial
- 
Constructor SummaryConstructorsConstructorDescriptionInstantiate an enabled control without any linked bones (torso only).
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCollisionListener(RagdollCollisionListener listener) Add a collision listener to this control.protected voidaddPhysics(PhysicsSpace space) Add all managed physics objects to the PhysicsSpace.voidanimateSubtree(PhysicsLink rootLink, float blendInterval) Begin blending the specified link and all its descendants to kinematic animation.voidblendToKinematicMode(float blendInterval, Transform endModelTransform) Begin blending all links to purely kinematic mode, driven by animation.floatcenterOfMass(Vector3f storeLocation, Vector3f storeVelocity) Calculate the ragdoll's total mass and center of mass.voidcloneFields(Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned control into a deep-cloned one, using the specified cloner and original to resolve copied fields.voidcollision(PhysicsCollisionEvent event) For internal use only: callback for collision events.jmeClone()Create a shallow clone for the JME cloner.voidread(JmeImporter im) De-serialize this control, for example when loading from a J3O file.protected voidremovePhysics(PhysicsSpace space) Remove all managed physics objects from the PhysicsSpace.voidsetContactResponseSubtree(PhysicsLink rootLink, boolean desiredResponse) Alter the contact-response setting of the specified link and all its descendants.voidsetDynamicChain(PhysicsLink startLink, int chainLength, Vector3f uniformAcceleration) Immediately put the specified link and all its ancestors (excluding the torso) into dynamic mode.voidsetDynamicSubtree(PhysicsLink rootLink, Vector3f uniformAcceleration) Immediately put the specified link and all its descendants into dynamic mode.voidImmediately put all links into purely kinematic mode.voidImmediately put this control into ragdoll mode.voidwrite(JmeExporter ex) Serialize this control, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.animation.DacLinkscreateSpatialData, findBone, findBoneLink, findLink, getBoneLinks, getSkeleton, getTorsoLink, isReady, listLinks, listRigidBodies, mass, physicsTick, prePhysicsTick, rebuild, removeSpatialData, setDamping, setGravity, setJointLimits, setMass, setMass, setPhysicsLocation, setPhysicsRotation, update, verifyAddedToSpatial, verifyReadyForDynamicModeMethods inherited from class com.jme3.bullet.animation.DacConfigurationaddUnlinkedDescendants, countLinkedBones, countLinks, damping, eventDispatchImpulseThreshold, findManager, getJointLimits, gravity, hasBoneLink, link, listLinkedBoneNames, managerMap, render, setApplyPhysicsLocal, setEventDispatchImpulseThreshold, totalMass, unlinkBoneMethods inherited from class com.jme3.bullet.control.AbstractPhysicsControlapplyPhysicsTransform, cloneForSpatial, getPhysicsSpace, getSpatial, getSpatialRotation, getSpatialTranslation, isApplyPhysicsLocal, isEnabled, setEnabled, setPhysicsSpace, setSpatial
- 
Field Details- 
logger35message logger for this class
 
- 
- 
Constructor Details- 
DynamicAnimControlpublic DynamicAnimControl()Instantiate an enabled control without any linked bones (torso only).
 
- 
- 
Method Details- 
addCollisionListenerAdd a collision listener to this control.- Parameters:
- listener- (not null, alias created)
 
- 
animateSubtreeBegin blending the specified link and all its descendants to kinematic animation.- Parameters:
- rootLink- the root of the subtree to bind (not null)
- blendInterval- the duration of the blend interval (in seconds, ≥0)
 
- 
blendToKinematicModeBegin blending all links to purely kinematic mode, driven by animation. TODO callback when the transition completesAllowed only when the control IS added to a spatial. - Parameters:
- blendInterval- the duration of the blend interval (in seconds, ≥0)
- endModelTransform- the desired local transform for the controlled spatial when the transition completes or null for no change to local transform (unaffected)
 
- 
centerOfMassCalculate the ragdoll's total mass and center of mass.Allowed only when the control IS added to a spatial. - Parameters:
- storeLocation- storage for the location of the center (in physics-space coordinates, modified if not null)
- storeVelocity- storage for the velocity of the center (psu/second in physics-space coordinates, modified if not null)
- Returns:
- the total mass (>0)
 
- 
setContactResponseSubtreeAlter the contact-response setting of the specified link and all its descendants. Note: recursive!Allowed only when the control IS added to a spatial. - Parameters:
- rootLink- the root of the subtree to modify (not null)
- desiredResponse- true for the usual rigid-body response, false for ghost-like response
 
- 
setDynamicChainImmediately put the specified link and all its ancestors (excluding the torso) into dynamic mode. Note: recursive!Allowed only when the control IS added to a spatial. - Parameters:
- startLink- the start of the chain to modify (not null)
- chainLength- the maximum number of links to modify (≥0)
- uniformAcceleration- the uniform acceleration vector (in physics-space coordinates, not null, unaffected)
 
- 
setDynamicSubtreeImmediately put the specified link and all its descendants into dynamic mode. Note: recursive!Allowed only when the control IS added to a spatial. - Parameters:
- rootLink- the root of the subtree to modify (not null)
- uniformAcceleration- the uniform acceleration vector (in physics-space coordinates, not null, unaffected)
 
- 
setKinematicModepublic void setKinematicMode()Immediately put all links into purely kinematic mode.Allowed only when the control IS added to a spatial. 
- 
setRagdollModepublic void setRagdollMode()Immediately put this control into ragdoll mode.Allowed only when the control IS added to a spatial and all links are "ready". 
- 
addPhysicsAdd all managed physics objects to the PhysicsSpace.- Overrides:
- addPhysicsin class- DacLinks
- Parameters:
- space- which physics space to add to (not null)
 
- 
cloneFieldsCallback fromClonerto convert this shallow-cloned control into a deep-cloned one, using the specified cloner and original to resolve copied fields.- Specified by:
- cloneFieldsin interface- JmeCloneable
- Overrides:
- cloneFieldsin class- DacLinks
- Parameters:
- cloner- the cloner that's cloning this control (not null, modified)
- original- the control from which this control was shallow-cloned (not null, unaffected)
 
- 
jmeCloneCreate a shallow clone for the JME cloner.- Specified by:
- jmeClonein interface- JmeCloneable
- Overrides:
- jmeClonein class- DacLinks
- Returns:
- a new instance
 
- 
readDe-serialize this control, for example when loading from a J3O file.- Specified by:
- readin interface- Savable
- Overrides:
- readin class- DacLinks
- Parameters:
- im- the importer (not null)
- Throws:
- IOException- from the importer
 
- 
removePhysicsRemove all managed physics objects from the PhysicsSpace.- Overrides:
- removePhysicsin class- DacLinks
- Parameters:
- space- which physics space to remove from (not null)
 
- 
writeSerialize this control, for example when saving to a J3O file.- Specified by:
- writein interface- Savable
- Overrides:
- writein class- DacLinks
- Parameters:
- ex- the exporter (not null)
- Throws:
- IOException- from the exporter
 
- 
collisionFor internal use only: callback for collision events.- Specified by:
- collisionin interface- PhysicsCollisionListener
- Parameters:
- event- (not null)
 
 
-