Package com.jme3.bullet.animation
Class DacLinks
java.lang.Object
com.jme3.bullet.control.AbstractPhysicsControl
com.jme3.bullet.animation.DacConfiguration
com.jme3.bullet.animation.DacLinks
- All Implemented Interfaces:
- PhysicsControl,- PhysicsTickListener,- Savable,- Control,- JmeCloneable,- Cloneable
- Direct Known Subclasses:
- DynamicAnimControl
Access a DynamicAnimControl at the PhysicsLink level once it's been added to
 a Spatial.
 
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
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddPhysics(PhysicsSpace space) Add all managed physics objects to the PhysicsSpace.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.protected voidcreateSpatialData(Spatial spatial) Create spatial-dependent data.Access the named bone.findBoneLink(String boneName) Access the BoneLink for the named bone.Access the named link.Access the list of bone links in a pre-order, depth-first traversal of the link hierarchy.Access the skeleton.Access the TorsoLink.booleanisReady()Test whether this control is ready for dynamic mode.jmeClone()Create a shallow clone for the JME cloner.<T extends PhysicsLink>
 List<T> Enumerate all physics links of the specified type managed by this control.Enumerate all rigid bodies managed by this control.floatRead the mass of the named bone/torso.voidphysicsTick(PhysicsSpace space, float timeStep) Callback from Bullet, invoked just after the physics has been stepped.voidprePhysicsTick(PhysicsSpace space, float timeStep) Callback from Bullet, invoked just before the physics is stepped.voidread(JmeImporter im) De-serialize this control, for example when loading from a J3O file.voidrebuild()Rebuild the ragdoll.protected voidremovePhysics(PhysicsSpace space) Remove all managed physics objects from the PhysicsSpace.protected voidremoveSpatialData(Spatial spat) Remove spatial-dependent data.voidsetDamping(float dampingRatio) Alter the viscous damping ratio for all rigid bodies, including new ones.voidsetGravity(Vector3f gravity) Alter this control's gravitational acceleration for Ragdoll mode.voidsetJointLimits(String boneName, RangeOfMotion rom) Alter the range of motion of the joint connecting the named BoneLink to its parent in the link hierarchy.voidsetMass(PhysicsLink link, float mass) Alter the mass of the specified link.voidAlter the mass of the named bone/torso.protected voidTranslate the torso to the specified location.protected voidsetPhysicsRotation(Quaternion quat) Rotate the torso to the specified orientation.voidupdate(float tpf) Update this control.protected voidverifyAddedToSpatial(String desiredAction) Verify that this control is added to a Spatial.voidverifyReadyForDynamicMode(String desiredAction) Verify that this control is ready for dynamic mode, which implies that it is added to a Spatial.voidwrite(JmeExporter ex) Serialize this control, for example when saving to a J3O file.Methods 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- 
logger3message logger for this class
 
- 
- 
Method Details- 
findBoneAccess the named bone.Allowed only when the control IS added to a spatial. - Parameters:
- boneName- the name of the skeleton bone to access
- Returns:
- the pre-existing instance, or null if not found
 
- 
findBoneLinkAccess the BoneLink for the named bone. Returns null if bone is not linked, or if the control is not added to a spatial.- Parameters:
- boneName- the name of the bone (not null, not empty)
- Returns:
- the pre-existing BoneLink, or null if not found
 
- 
findLinkAccess the named link. Returns null if the name is invalid, or if the control is not added to a spatial.- Parameters:
- linkName- the name of the link (not null, not empty)
- Returns:
- the pre-existing link, or null if not found
 
- 
getSkeletonAccess the skeleton. Returns null if the control is not added to a spatial.- Returns:
- the pre-existing skeleton, or null
 
- 
getTorsoLinkAccess the TorsoLink. Returns null if the control is not added to a spatial.- Returns:
- the pre-existing TorsoLink, or null
 
- 
isReadypublic boolean isReady()Test whether this control is ready for dynamic mode.- Returns:
- true if ready, otherwise false
 
- 
listLinksEnumerate all physics links of the specified type managed by this control.- Type Parameters:
- T- subclass of PhysicsLink
- Parameters:
- linkType- the subclass of PhysicsLink to search for (not null)
- Returns:
- a new array of links (not null, not empty)
 
- 
listRigidBodiesEnumerate all rigid bodies managed by this control.Allowed only when the control IS added to a spatial. - Returns:
- a new array of pre-existing rigid bodies (not null, not empty)
 
- 
rebuildpublic void rebuild()Rebuild the ragdoll. This is useful if you applied scale to the model after it was initialized.Allowed only when the control IS added to a spatial. 
- 
setMassAlter the mass of the specified link.- Parameters:
- link- the link to modify (not null)
- mass- the desired mass (>0)
 
- 
verifyReadyForDynamicModeVerify that this control is ready for dynamic mode, which implies that it is added to a Spatial.- Parameters:
- desiredAction- (not null, not empty)
 
- 
getBoneLinksAccess the list of bone links in a pre-order, depth-first traversal of the link hierarchy.- Returns:
- the pre-existing list (not null)
 
- 
verifyAddedToSpatialVerify that this control is added to a Spatial.- Parameters:
- desiredAction- (not null, not empty)
 
- 
addPhysicsAdd all managed physics objects to the PhysicsSpace.- Specified by:
- addPhysicsin class- AbstractPhysicsControl
- 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- DacConfiguration
- 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)
 
- 
createSpatialDataCreate spatial-dependent data. Invoked each time the control is added to a spatial. Also invoked byrebuild().- Specified by:
- createSpatialDatain class- AbstractPhysicsControl
- Parameters:
- spatial- the controlled spatial (not null)
 
- 
jmeCloneCreate a shallow clone for the JME cloner.- Specified by:
- jmeClonein interface- JmeCloneable
- Overrides:
- jmeClonein class- DacConfiguration
- Returns:
- a new instance
 
- 
massRead the mass of the named bone/torso.- Overrides:
- massin class- DacConfiguration
- Parameters:
- boneName- the name of the bone/torso (not null)
- Returns:
- the mass (>0) or NaN if undetermined
 
- 
readDe-serialize this control, for example when loading from a J3O file.- Specified by:
- readin interface- Savable
- Overrides:
- readin class- DacConfiguration
- Parameters:
- im- importer (not null)
- Throws:
- IOException- from importer
 
- 
removePhysicsRemove all managed physics objects from the PhysicsSpace.- Specified by:
- removePhysicsin class- AbstractPhysicsControl
- Parameters:
- space- which physics space to remove from (not null)
 
- 
removeSpatialDataRemove spatial-dependent data. Invoked each time this control is rebuilt or removed from a spatial.- Specified by:
- removeSpatialDatain class- AbstractPhysicsControl
- Parameters:
- spat- the previously controlled spatial (unused)
 
- 
setDampingpublic void setDamping(float dampingRatio) Alter the viscous damping ratio for all rigid bodies, including new ones.- Overrides:
- setDampingin class- DacConfiguration
- Parameters:
- dampingRatio- the desired damping ratio (non-negative, 0→no damping, 1→critically damped, default=0.6)
 
- 
setGravityAlter this control's gravitational acceleration for Ragdoll mode.- Overrides:
- setGravityin class- DacConfiguration
- Parameters:
- gravity- the desired acceleration vector (in physics-space coordinates, not null, unaffected, default=0,-9.8,0)
 
- 
setJointLimitsAlter the range of motion of the joint connecting the named BoneLink to its parent in the link hierarchy.- Overrides:
- setJointLimitsin class- DacConfiguration
- Parameters:
- boneName- the name of the BoneLink (not null, not empty)
- rom- the desired range of motion (not null)
 
- 
setMassAlter the mass of the named bone/torso.- Overrides:
- setMassin class- DacConfiguration
- Parameters:
- boneName- the name of the bone, or torsoName (not null)
- mass- the desired mass (>0)
 
- 
setPhysicsLocationTranslate the torso to the specified location.- Specified by:
- setPhysicsLocationin class- AbstractPhysicsControl
- Parameters:
- vec- desired location (not null, unaffected)
 
- 
setPhysicsRotationRotate the torso to the specified orientation.- Specified by:
- setPhysicsRotationin class- AbstractPhysicsControl
- Parameters:
- quat- desired orientation (not null, unaffected)
 
- 
updatepublic void update(float tpf) 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)
 
- 
writeSerialize this control, for example when saving to a J3O file.- Specified by:
- writein interface- Savable
- Overrides:
- writein class- DacConfiguration
- Parameters:
- ex- exporter (not null)
- Throws:
- IOException- from exporter
 
- 
physicsTickCallback from Bullet, invoked just after the physics has been stepped. Used to re-activate any deactivated rigid bodies.- Specified by:
- physicsTickin interface- PhysicsTickListener
- Parameters:
- space- the space that was just stepped (not null)
- timeStep- the time per physics step (in seconds, ≥0)
 
- 
prePhysicsTickCallback from Bullet, invoked just before the physics is stepped. A good time to clear/apply forces.- Specified by:
- prePhysicsTickin interface- PhysicsTickListener
- Parameters:
- space- the space that is about to be stepped (not null)
- timeStep- the time per physics step (in seconds, ≥0)
 
 
-