Package com.jme3.bullet.animation
Class DacConfiguration
java.lang.Object
com.jme3.bullet.control.AbstractPhysicsControl
com.jme3.bullet.animation.DacConfiguration
- All Implemented Interfaces:
PhysicsControl,com.jme3.export.Savable,com.jme3.scene.control.Control,com.jme3.util.clone.JmeCloneable,Cloneable
- Direct Known Subclasses:
DacLinks
Configure a DynamicAnimControl and access its configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Loggermessage logger for this classstatic final Stringname for the ragdoll's torso, must not be used for any boneFields inherited from class com.jme3.bullet.control.AbstractPhysicsControl
added, logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiate an enabled Control without any attachments or linked bones (torso only). -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddUnlinkedDescendants(com.jme3.anim.Joint startJoint, Collection<com.jme3.anim.Joint> addResult) Add unlinked descendants of the specified Joint to the specified collection.protected voidaddUnlinkedDescendants(com.jme3.animation.Bone startBone, Collection<com.jme3.animation.Bone> addResult) Add unlinked descendants of the specified Bone to the specified collection.voidConfigure the specified model as an attachment.voidattach(String boneName, LinkConfig config, com.jme3.scene.Spatial model) Configure the specified model as an attachment.attachmentConfig(String boneName) Access the configuration of the attachment link associated with the named bone.floatattachmentMass(String boneName) Return the mass of the attachment associated with the named bone.voidcloneFields(com.jme3.util.clone.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.Access the configuration of the named bone/torso.intCount the attachments.intCount the linked bones.intCount the links.floatdamping()Return the damping ratio for new rigid bodies.voidUnlink the AttachmentLink associated with the named bone.floatReturn the event-dispatch impulse threshold of this control.protected StringfindManager(com.jme3.anim.Joint startJoint) Find the manager of the specified armature joint.protected StringfindManager(com.jme3.animation.Bone startBone) Find the manager of the specified Bone.com.jme3.scene.SpatialgetAttachmentModel(String boneName) Access the model attached to the named bone.getJointLimits(String boneName) Access the nominal range of motion for the joint connecting the named linked bone to its parent in the hierarchy.com.jme3.math.Vector3fgravity(com.jme3.math.Vector3f storeResult) Copy this control's gravitational acceleration for Ragdoll mode.booleanhasAttachmentLink(String boneName) Test whether an AttachmentLink exists for the named bone.booleanhasBoneLink(String boneName) Test whether a BoneLink exists for the named bone.intDetermine the maximum number of physics-joint hops across which bodies ignore collisions.voidlink(String boneName, float mass, RangeOfMotion rom) Link the named bone using the specified mass and range of motion.voidlink(String boneName, LinkConfig config, RangeOfMotion rom) Link the named bone using the specified configuration and range of motion.String[]Enumerate bones with attachment links.String[]Enumerate bones with bone links.Return the name of the main bone.protected String[]managerMap(com.jme3.anim.Armature armature) Create a map from joint indices to the names of the armature joints that manage them.protected String[]managerMap(com.jme3.animation.Skeleton skeleton) Create a map from bone indices to the names of the bones that manage them.floatReturn the mass of the named bone/torso.voidread(com.jme3.export.JmeImporter importer) De-serialize this Control from the specified importer, for example when loading from a J3O file.floatReturn the relative tolerance for comparing scale factors.voidsetApplyPhysicsLocal(boolean applyPhysicsLocal) Alter whether physics-space coordinates should match the spatial's local coordinates.voidsetAttachmentConfig(String boneName, LinkConfig config) Alter the configuration of the attachment associated with the named bone.voidsetAttachmentMass(String boneName, float mass) Alter the mass of the attachment associated with the named bone.voidsetConfig(String boneName, LinkConfig config) Alter the configuration of the named bone/torso.voidsetDamping(float dampingRatio) Alter the viscous damping ratio for new rigid bodies.voidsetEventDispatchImpulseThreshold(float threshold) Alter the event-dispatch impulse threshold of this control.voidsetGravity(com.jme3.math.Vector3f gravity) Alter this control's gravitational acceleration for Ragdoll mode.voidsetIgnoredHops(int numHops) Alter the maximum number of physics-joint hops across which bodies will ignore collisions.voidsetJointLimits(String boneName, RangeOfMotion rom) Alter the range of motion of the joint connecting the named BoneLink to its parent in the link hierarchy.voidsetMainBoneName(String boneName) Specify the main bone.voidAlter the mass of the named bone/torso.voidsetRelativeTolerance(float newTolerance) Alter the relative tolerance for comparing scale factors.floatCalculate the ragdoll's total mass, including attachments.voidunlinkBone(String boneName) Unlink the BoneLink of the named bone.voidwrite(com.jme3.export.JmeExporter exporter) Serialize this Control to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.control.AbstractPhysicsControl
addPhysics, applyPhysicsTransform, cloneForSpatial, createSpatialData, getPhysicsSpace, getSpatial, getSpatialRotation, getSpatialTranslation, isApplyPhysicsLocal, isEnabled, jmeClone, removePhysics, removeSpatialData, render, setEnabled, setPhysicsLocation, setPhysicsRotation, setPhysicsSpace, setSpatialMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.scene.control.Control
update
-
Field Details
-
logger2
message logger for this class -
torsoName
name for the ragdoll's torso, must not be used for any bone- See Also:
-
-
Constructor Details
-
DacConfiguration
protected DacConfiguration()Instantiate an enabled Control without any attachments or linked bones (torso only).
-
-
Method Details
-
attach
Configure the specified model as an attachment.- Parameters:
boneName- the name of the associated bone (not null, not empty)mass- the desired mass of the model (>0)model- the model to attach (not null, orphan, alias created)
-
attach
Configure the specified model as an attachment.- Parameters:
boneName- the name of the associated bone (not null, not empty)config- the desired configuration (not null)model- the model to attach (not null, orphan, alias created)
-
attachmentConfig
Access the configuration of the attachment link associated with the named bone.- Parameters:
boneName- the name of the associated bone (not null, not empty)- Returns:
- the pre-existing configuration (not null)
-
attachmentMass
Return the mass of the attachment associated with the named bone.- Parameters:
boneName- the name of the associated bone (not null, not empty)- Returns:
- the mass (in physics units, >0) or NaN if undetermined
-
config
Access the configuration of the named bone/torso.- Parameters:
boneName- the name of the bone/torso (not null)- Returns:
- the pre-existing configuration (not null)
-
countAttachments
public int countAttachments()Count the attachments.- Returns:
- count (≥0)
-
countLinkedBones
public int countLinkedBones()Count the linked bones.- Returns:
- count (≥0)
-
countLinks
public int countLinks()Count the links.- Returns:
- count (≥0)
-
damping
public float damping()Return the damping ratio for new rigid bodies.- Returns:
- the viscous damping ratio (0→no damping, 1→critically damped)
-
detach
Unlink the AttachmentLink associated with the named bone.Allowed only when the control is NOT added to a Spatial.
- Parameters:
boneName- the name of the associated bone (not null, not empty)
-
eventDispatchImpulseThreshold
public float eventDispatchImpulseThreshold()Return the event-dispatch impulse threshold of this control.- Returns:
- the threshold value (≥0)
-
getAttachmentModel
Access the model attached to the named bone.- Parameters:
boneName- the name of the associated bone (not null, not empty)- Returns:
- the orphan spatial (not null)
-
getJointLimits
Access the nominal range of motion for the joint connecting the named linked bone to its parent in the hierarchy.- Parameters:
boneName- the name of the linked bone (not null, not empty)- Returns:
- the pre-existing instance (not null)
-
gravity
public com.jme3.math.Vector3f gravity(com.jme3.math.Vector3f storeResult) Copy this control's gravitational acceleration for Ragdoll mode.- Parameters:
storeResult- storage for the result (modified if not null)- Returns:
- an acceleration vector (in physics-space coordinates, either storeResult or a new vector, not null)
-
hasAttachmentLink
Test whether an AttachmentLink exists for the named bone.- Parameters:
boneName- the name of the associated bone (may be null)- Returns:
- true if found, otherwise false
-
hasBoneLink
Test whether a BoneLink exists for the named bone.- Parameters:
boneName- the name of the bone (may be null)- Returns:
- true if found, otherwise false
-
ignoredHops
public int ignoredHops()Determine the maximum number of physics-joint hops across which bodies ignore collisions.- Returns:
- the number of hops (≥0)
-
link
Link the named bone using the specified mass and range of motion.Allowed only when the control is NOT added to a Spatial.
- Parameters:
boneName- the name of the bone to link (not null, not empty)mass- the desired mass of the bone (>0)rom- the desired range of motion (not null)- See Also:
-
link
Link the named bone using the specified configuration and range of motion.Allowed only when the control is NOT added to a Spatial.
- Parameters:
boneName- the name of the bone to link (not null, not empty)config- the desired configuration (not null)rom- the desired range of motion (not null)- See Also:
-
listAttachmentBoneNames
Enumerate bones with attachment links.- Returns:
- a new array of bone names (not null, may be empty)
-
listLinkedBoneNames
Enumerate bones with bone links.- Returns:
- a new array of bone names (not null, may be empty)
-
mainBoneName
Return the name of the main bone.- Returns:
- the name of the bone, or null if the main bone hasn't been determined yet
-
mass
Return the mass of the named bone/torso.- Parameters:
boneName- the name of the bone/torso (not null)- Returns:
- the mass (in physics units, >0) or NaN if undetermined
-
relativeTolerance
public float relativeTolerance()Return the relative tolerance for comparing scale factors.- Returns:
- the relative tolerance (≥0)
-
setAttachmentConfig
Alter the configuration of the attachment associated with the named bone.- Parameters:
boneName- the name of the associated bone (not null, not empty)config- the desired configuration (not null)
-
setAttachmentMass
Alter the mass of the attachment associated with the named bone.- Parameters:
boneName- the name of the associated bone (not null, not empty)mass- the desired mass (>0)
-
setConfig
Alter the configuration of the named bone/torso.- Parameters:
boneName- the name of the bone, or torsoName (not null)config- the desired configuration (not null)
-
setDamping
public void setDamping(float dampingRatio) Alter the viscous damping ratio for new rigid bodies.- Parameters:
dampingRatio- the desired damping ratio (non-negative, 0→no damping, 1→critically damped, default=0.6)
-
setEventDispatchImpulseThreshold
public void setEventDispatchImpulseThreshold(float threshold) Alter the event-dispatch impulse threshold of this control.- Parameters:
threshold- the desired threshold (≥0)
-
setGravity
public void setGravity(com.jme3.math.Vector3f gravity) Alter this control's gravitational acceleration for Ragdoll mode.- Parameters:
gravity- the desired acceleration vector (in physics-space coordinates, not null, unaffected, default=(0,-9.8,0))
-
setIgnoredHops
public void setIgnoredHops(int numHops) Alter the maximum number of physics-joint hops across which bodies will ignore collisions.Allowed only when the control is NOT added to a Spatial.
- Parameters:
numHops- the desired number of hops (≥0, default=1)
-
setJointLimits
Alter the range of motion of the joint connecting the named BoneLink to its parent in the link hierarchy.- Parameters:
boneName- the name of the BoneLink (not null, not empty)rom- the desired range of motion (not null)
-
setMainBoneName
Specify the main bone.- Parameters:
boneName- the name of the desired bone, or null to determine the main bone heuristically when the control is added to a spatial
-
setMass
Alter the mass of the named bone/torso.- Parameters:
boneName- the name of the bone, or torsoName (not null)mass- the desired mass (>0)
-
setRelativeTolerance
public void setRelativeTolerance(float newTolerance) Alter the relative tolerance for comparing scale factors.- Parameters:
newTolerance- the desired value (≥0, default=0.001)
-
totalMass
public float totalMass()Calculate the ragdoll's total mass, including attachments.- Returns:
- the total mass (>0) or NaN if undetermined
-
unlinkBone
Unlink the BoneLink of the named bone.Allowed only when the control is NOT added to a Spatial.
- Parameters:
boneName- the name of the bone to unlink (not null, not empty)
-
addUnlinkedDescendants
protected void addUnlinkedDescendants(com.jme3.animation.Bone startBone, Collection<com.jme3.animation.Bone> addResult) Add unlinked descendants of the specified Bone to the specified collection. Note: recursive!- Parameters:
startBone- the starting Bone (not null, aliases created)addResult- the collection of skeleton bones to append to (not null, modified)
-
addUnlinkedDescendants
protected void addUnlinkedDescendants(com.jme3.anim.Joint startJoint, Collection<com.jme3.anim.Joint> addResult) Add unlinked descendants of the specified Joint to the specified collection. Note: recursive!- Parameters:
startJoint- the starting Joint (not null, aliases created)addResult- the collection of armature joints to append to (not null, modified)
-
findManager
Find the manager of the specified Bone.- Parameters:
startBone- the bone (not null, unaffected)- Returns:
- a bone/torso name (not null)
-
findManager
Find the manager of the specified armature joint.- Parameters:
startJoint- the joint (not null, unaffected)- Returns:
- a joint/torso name (not null)
-
managerMap
Create a map from joint indices to the names of the armature joints that manage them.- Parameters:
armature- (not null, unaffected)- Returns:
- a new array of joint/torso names (not null)
-
managerMap
Create a map from bone indices to the names of the bones that manage them.- Parameters:
skeleton- (not null, unaffected)- Returns:
- a new array of bone/torso names (not null)
-
cloneFields
Callback fromClonerto convert this shallow-cloned Control into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
cloneFieldsin interfacecom.jme3.util.clone.JmeCloneable- Overrides:
cloneFieldsin classAbstractPhysicsControl- Parameters:
cloner- the Cloner that's cloning this Control (not null, modified)original- the instance from which this Control was shallow-cloned (not null, unaffected)
-
read
De-serialize this Control from the specified importer, for example when loading from a J3O file.- Specified by:
readin interfacecom.jme3.export.Savable- Overrides:
readin classAbstractPhysicsControl- Parameters:
importer- (not null)- Throws:
IOException- from the importer
-
setApplyPhysicsLocal
public void setApplyPhysicsLocal(boolean applyPhysicsLocal) Alter whether physics-space coordinates should match the spatial's local coordinates.- Overrides:
setApplyPhysicsLocalin classAbstractPhysicsControl- Parameters:
applyPhysicsLocal- true→match local coordinates, false→match world coordinates (default=false)
-
write
Serialize this Control to the specified exporter, for example when saving to a J3O file.- Specified by:
writein interfacecom.jme3.export.Savable- Overrides:
writein classAbstractPhysicsControl- Parameters:
exporter- (not null)- Throws:
IOException- from the exporter
-