Package com.jme3.bullet.animation
Class TorsoLink
java.lang.Object
com.jme3.bullet.animation.PhysicsLink
com.jme3.bullet.animation.TorsoLink
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.util.clone.JmeCloneable
,Cloneable
Link the torso of an animated model to a rigid body in a ragdoll.
-
Field Summary
Fields inherited from class com.jme3.bullet.animation.PhysicsLink
logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
No-argument constructor needed by SavableClassUtil. -
Method Summary
Modifier and TypeMethodDescriptionvoid
blendToKinematicMode
(KinematicSubmode submode, float blendInterval, com.jme3.math.Transform endModelTransform) Begin blending this link to a purely kinematic mode.int
boneIndex
(int managedIndex) Determine the index in the Armature/Skeleton of the indexed managed bone.void
cloneFields
(com.jme3.util.clone.Cloner cloner, Object original) Callback fromCloner
to convert this shallow-cloned link into a deep-cloned one, using the specified Cloner and original to resolve copied fields.final int
Determine the number of managed skeleton bones or armature joints.protected void
Update this link in Dynamic mode, setting the local transform of the model's root spatial based on the transform of the linked rigid body.void
freeze
(boolean forceKinematic) Immediately freeze this link.protected void
kinematicUpdate
(float tpf) Update this link in blended Kinematic mode.name()
Unambiguously identify this link by name, within its DynamicAnimControl.void
read
(com.jme3.export.JmeImporter importer) De-serialize this link from the specified importer, for example when loading from a J3O file.void
setDynamic
(com.jme3.math.Vector3f uniformAcceleration) Immediately put this link into dynamic mode.void
setEndBoneTransforms
(com.jme3.math.Transform[] transforms) Alter the local transform for each managed bone at the end of a blend interval, for use with theReset
kinematic submode.void
setLocalTransform
(int mbIndex, com.jme3.math.Transform localTransform) Alter the local transform of the indexed managed bone.void
Immediately put this link into ragdoll mode.void
write
(com.jme3.export.JmeExporter exporter) Serialize this link to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.animation.PhysicsLink
addIKController, blendToKinematicMode, boneName, countChildren, density, disableAllIKControllers, getArmatureJoint, getBone, getControl, getJoint, getParent, getRigidBody, isKinematic, isReleased, jmeClone, kinematicWeight, listChildren, listIKControllers, localOffset, physicsTransform, removeIKController, setJoint, setParent, setRigidBody, velocity
-
Field Details
-
logger2
message logger for this class
-
-
Constructor Details
-
TorsoLink
protected TorsoLink()No-argument constructor needed by SavableClassUtil.
-
-
Method Details
-
blendToKinematicMode
public void blendToKinematicMode(KinematicSubmode submode, float blendInterval, com.jme3.math.Transform endModelTransform) Begin blending this link to a purely kinematic mode.- Parameters:
submode
- enum value (not null)blendInterval
- the duration of the blend interval (in seconds, ≥0)endModelTransform
- the desired local transform for the controlled spatial when the blend completes (alias created) or null for no change to the local transform
-
boneIndex
public int boneIndex(int managedIndex) Determine the index in the Armature/Skeleton of the indexed managed bone.- Parameters:
managedIndex
- which managed bone (0 = the linked bone, ≥0, <numManaged)- Returns:
- the index in the Armature or Skeleton (≥0)
-
countManaged
public final int countManaged()Determine the number of managed skeleton bones or armature joints.- Returns:
- the count (≥1)
-
setEndBoneTransforms
public void setEndBoneTransforms(com.jme3.math.Transform[] transforms) Alter the local transform for each managed bone at the end of a blend interval, for use with theReset
kinematic submode.- Parameters:
transforms
- (not null, one element for each managed bone, no null elements, alias created)
-
setLocalTransform
public void setLocalTransform(int mbIndex, com.jme3.math.Transform localTransform) Alter the local transform of the indexed managed bone. Use this method to animate managed bones. Effective only once the link has been updated.- Parameters:
mbIndex
- the index of the managed bone (≥1, <numManaged)localTransform
- the desired Transform (not null, unaffected)
-
cloneFields
Callback fromCloner
to convert this shallow-cloned link into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
cloneFields
in interfacecom.jme3.util.clone.JmeCloneable
- Overrides:
cloneFields
in classPhysicsLink
- Parameters:
cloner
- the Cloner that's cloning this link (not null)original
- the instance from which this link was shallow-cloned (not null, unaffected)
-
dynamicUpdate
protected void dynamicUpdate()Update this link in Dynamic mode, setting the local transform of the model's root spatial based on the transform of the linked rigid body.- Specified by:
dynamicUpdate
in classPhysicsLink
-
freeze
public void freeze(boolean forceKinematic) Immediately freeze this link.- Specified by:
freeze
in classPhysicsLink
- Parameters:
forceKinematic
- ignored
-
kinematicUpdate
protected void kinematicUpdate(float tpf) Update this link in blended Kinematic mode.- Overrides:
kinematicUpdate
in classPhysicsLink
- Parameters:
tpf
- the time interval between frames (in seconds, ≥0)
-
name
Unambiguously identify this link by name, within its DynamicAnimControl.- Specified by:
name
in classPhysicsLink
- Returns:
- a brief textual description (not null, not empty)
-
read
De-serialize this link from the specified importer, for example when loading from a J3O file.- Specified by:
read
in interfacecom.jme3.export.Savable
- Overrides:
read
in classPhysicsLink
- Parameters:
importer
- (not null)- Throws:
IOException
- from the importer
-
setDynamic
public void setDynamic(com.jme3.math.Vector3f uniformAcceleration) Immediately put this link into dynamic mode. The control must be "ready".- Overrides:
setDynamic
in classPhysicsLink
- Parameters:
uniformAcceleration
- the uniform acceleration vector to apply (in physics-space coordinates, not null, unaffected)
-
setRagdollMode
public void setRagdollMode()Immediately put this link into ragdoll mode. The control must be ready for dynamic mode.- Overrides:
setRagdollMode
in classPhysicsLink
-
write
Serialize this link to the specified exporter, for example when saving to a J3O file.- Specified by:
write
in interfacecom.jme3.export.Savable
- Overrides:
write
in classPhysicsLink
- Parameters:
exporter
- (not null)- Throws:
IOException
- from the exporter
-