Package com.jme3.bullet.animation
Class BoneLink
java.lang.Object
com.jme3.bullet.animation.PhysicsLink
com.jme3.bullet.animation.BoneLink
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.util.clone.JmeCloneable
,Cloneable
Link an animated bone in an Armature/Skeleton to a jointed rigid body in a
ragdoll.
-
Field Summary
Fields inherited from class com.jme3.bullet.animation.PhysicsLink
logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
BoneLink()
No-argument constructor needed by SavableClassUtil. -
Method Summary
Modifier and TypeMethodDescriptionvoid
blendToKinematicMode
(KinematicSubmode submode, float blendInterval) 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.int
Determine the number of managed skeleton bones or armature joints.protected void
Update this link in Dynamic mode, setting the linked bone's transform based on the transform of the rigid body.com.jme3.math.Vector3f[]
Estimate the footprint of this link.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
setDynamic
(com.jme3.math.Vector3f uniformAcceleration, boolean lockX, boolean lockY, boolean lockZ) Immediately put this link into dynamic mode and update the range of motion of its joint.void
setDynamic
(com.jme3.math.Vector3f uniformAcceleration, com.jme3.math.Quaternion userRotation) Immediately put this link into dynamic mode and lock its PhysicsJoint at the specified rotation.void
setEndBoneTransforms
(com.jme3.math.Transform[] transforms) Alter the local transform for each managed bone at the end of a blend toReset
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
-
BoneLink
protected BoneLink()No-argument constructor needed by SavableClassUtil.
-
-
Method Details
-
blendToKinematicMode
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)
-
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 int countManaged()Determine the number of managed skeleton bones or armature joints.- Returns:
- the count (≥1)
-
footprint
public com.jme3.math.Vector3f[] footprint()Estimate the footprint of this link.- Returns:
- the corner locations of a rectangle (in world coordinates)
-
setDynamic
public void setDynamic(com.jme3.math.Vector3f uniformAcceleration, boolean lockX, boolean lockY, boolean lockZ) Immediately put this link into dynamic mode and update the range of motion of its joint.- Parameters:
uniformAcceleration
- the uniform acceleration vector (in physics-space coordinates, not null, unaffected)lockX
- true to lock the joint's X-axislockY
- true to lock the joint's Y-axislockZ
- true to lock the joint's Z-axis
-
setDynamic
public void setDynamic(com.jme3.math.Vector3f uniformAcceleration, com.jme3.math.Quaternion userRotation) Immediately put this link into dynamic mode and lock its PhysicsJoint at the specified rotation.The control must be "ready" for dynamic mode.
- Parameters:
uniformAcceleration
- the uniform acceleration vector (in physics-space coordinates, not null, unaffected)userRotation
- the desired rotation relative to the bind rotation of the linked bone (not null, unaffected)
-
setEndBoneTransforms
public void setEndBoneTransforms(com.jme3.math.Transform[] transforms) Alter the local transform for each managed bone at the end of a blend toReset
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 other than the linked one. 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 linked bone's transform based on the transform of the rigid body.- Specified by:
dynamicUpdate
in classPhysicsLink
-
freeze
public void freeze(boolean forceKinematic) Immediately freeze this link.- Specified by:
freeze
in classPhysicsLink
- Parameters:
forceKinematic
- true→force to kinematic mode, false→preserve mode
-
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
-