Package com.jme3.bullet.animation
Class PhysicsLink
java.lang.Object
com.jme3.bullet.animation.PhysicsLink
- All Implemented Interfaces:
- Savable,- JmeCloneable,- Cloneable
The abstract base class used by DynamicAnimControl to link pieces of a JME
 model to their corresponding collision objects in a ragdoll. Subclasses
 include BoneLink and TorsoLink. The links in each DynamicAnimControl form a
 hierarchy with the TorsoLink at its root.
 
This class is shared between JBullet and Native Bullet.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedNo-argument constructor needed by SavableClassUtil.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidblendToKinematicMode(float blendInterval) Begin blending this link to a purely kinematic mode.boneName()Read the name of the corresponding bone.voidcloneFields(Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned link into a deep-cloned one, using the specified cloner and original to resolve copied fields.intCount this link's immediate children in the link hierarchy.protected abstract voidUpdate this link in Dynamic mode, setting the linked bone's transform based on the transform of the rigid body.final JointgetBone()Access the corresponding bone.Access the control that manages this link.getJoint()Access the joint between this link's rigid body and that of its parent.Access this link's parent/manager in the link hierarchy.Access the linked rigid body.booleanTest whether the link is in kinematic mode.jmeClone()Create a shallow clone for the JME cloner.protected voidkinematicUpdate(float tpf) Update this link in blended Kinematic mode.floatRead the kinematic weight of this link.Enumerate this link's immediate children in the link hierarchy.protected Vector3flocalOffset(Vector3f storeResult) Copy the local offset of this link.abstract Stringname()Unambiguously identify this link by name, within its DynamicAnimControl.physicsTransform(Transform storeResult) Calculate a physics transform for the rigid body (to match the skeleton bone).voidread(JmeImporter im) De-serialize this link, for example when loading from a J3O file.voidsetDynamic(Vector3f uniformAcceleration) Immediately put this link into dynamic mode.protected final voidsetJoint(PhysicsJoint joint) Assign a physics joint to this link, or cancel the assigned joint.protected final voidsetParent(PhysicsLink parent) Assign a parent/manager for this link.protected voidsetRigidBody(PhysicsRigidBody body) Alter the rigid body for this link.voidwrite(JmeExporter ex) Serialize this link, for example when saving to a J3O file.
- 
Field Details- 
loggermessage logger for this class
 
- 
- 
Constructor Details- 
PhysicsLinkprotected PhysicsLink()No-argument constructor needed by SavableClassUtil. Do not invoke directly!
 
- 
- 
Method Details- 
boneNameRead the name of the corresponding bone.- Returns:
- the bone name (not null)
 
- 
countChildrenpublic int countChildren()Count this link's immediate children in the link hierarchy.- Returns:
- the count (≥0)
 
- 
getBoneAccess the corresponding bone.- Returns:
- the pre-existing instance (not null)
 
- 
getControlAccess the control that manages this link.- Returns:
- the pre-existing instance (not null)
 
- 
getJointAccess the joint between this link's rigid body and that of its parent.- Returns:
- the pre-existing instance, or null for the torso
 
- 
getParentAccess this link's parent/manager in the link hierarchy.- Returns:
- the link, or null if none
 
- 
getRigidBodyAccess the linked rigid body.- Returns:
- the pre-existing instance (not null)
 
- 
isKinematicpublic boolean isKinematic()Test whether the link is in kinematic mode.- Returns:
- true if kinematic, or false if purely dynamic
 
- 
kinematicWeightpublic float kinematicWeight()Read the kinematic weight of this link.- Returns:
- 0 if purely dynamic, 1 if purely kinematic
 
- 
listChildrenEnumerate this link's immediate children in the link hierarchy.- Returns:
- a new array (not null)
 
- 
nameUnambiguously identify this link by name, within its DynamicAnimControl.- Returns:
- a text string (not null, not empty)
 
- 
physicsTransformCalculate a physics transform for the rigid body (to match the skeleton bone).- Parameters:
- storeResult- storage for the result (modified if not null)
- Returns:
- the calculated transform (in physics-space coordinates, either storeResult or a new transform, not null)
 
- 
setDynamicImmediately put this link into dynamic mode. The control must be "ready".- Parameters:
- uniformAcceleration- the uniform acceleration vector to apply (in physics-space coordinates, not null, unaffected)
 
- 
blendToKinematicModeprotected void blendToKinematicMode(float blendInterval) Begin blending this link to a purely kinematic mode.- Parameters:
- blendInterval- the duration of the blend interval (in seconds, ≥0)
 
- 
dynamicUpdateprotected abstract void dynamicUpdate()Update this link in Dynamic mode, setting the linked bone's transform based on the transform of the rigid body.
- 
kinematicUpdateprotected void kinematicUpdate(float tpf) Update this link in blended Kinematic mode.- Parameters:
- tpf- the time interval between frames (in seconds, ≥0)
 
- 
localOffsetCopy the local offset of this link.- Parameters:
- storeResult- storage for the result (modified if not null)
- Returns:
- the offset (in bone local coordinates, either storeResult or a new vector, not null)
 
- 
setJointAssign a physics joint to this link, or cancel the assigned joint.- Parameters:
- joint- (may be null, alias created)
 
- 
setParentAssign a parent/manager for this link.- Parameters:
- parent- (not null, alias created)
 
- 
setRigidBodyAlter the rigid body for this link.- Parameters:
- body- the desired rigid body (not null, alias created)
 
- 
cloneFieldsCallback fromClonerto convert this shallow-cloned link into a deep-cloned one, using the specified cloner and original to resolve copied fields.- Specified by:
- cloneFieldsin interface- JmeCloneable
- Parameters:
- cloner- the cloner that's cloning this link (not null)
- original- the instance from which this link was shallow-cloned (unused)
 
- 
jmeCloneCreate a shallow clone for the JME cloner.- Specified by:
- jmeClonein interface- JmeCloneable
- Returns:
- a new instance
 
- 
readDe-serialize this link, for example when loading from a J3O file.- Specified by:
- readin interface- Savable
- Parameters:
- im- importer (not null)
- Throws:
- IOException- from importer
 
- 
writeSerialize this link, for example when saving to a J3O file.- Specified by:
- writein interface- Savable
- Parameters:
- ex- exporter (not null)
- Throws:
- IOException- from exporter
 
 
-