Package com.jme3.bullet.animation
Class AttachmentLink
java.lang.Object
com.jme3.bullet.animation.PhysicsLink
com.jme3.bullet.animation.AttachmentLink
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.util.clone.JmeCloneable
,Cloneable
Link an attachments node to a jointed 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
(float blendInterval, com.jme3.math.Transform endModelTransform) Begin blending this link to a purely kinematic mode.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.protected void
Update this link in Dynamic mode, setting the local transform of the attached model based on the transform of the linked rigid body.void
freeze
(boolean forceKinematic) Immediately freeze this link.com.jme3.scene.Spatial
Access the attached model (not the attachment node).boolean
Test whether the attached model has been released.protected void
kinematicUpdate
(float tpf) Update this link in blended Kinematic mode.name()
Unambiguously identify this link by name, within its DynamicAnimControl.final com.jme3.math.Transform
physicsTransform
(com.jme3.math.Transform storeResult) Calculate a physics transform for the rigid body.void
read
(com.jme3.export.JmeImporter importer) De-serialize this link from the specified importer, for example when loading from a J3O file.void
release()
Release the attached model.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, jmeClone, kinematicWeight, listChildren, listIKControllers, localOffset, removeIKController, setDynamic, setJoint, setParent, setRigidBody, velocity
-
Field Details
-
logger2
message logger for this class
-
-
Constructor Details
-
AttachmentLink
protected AttachmentLink()No-argument constructor needed by SavableClassUtil.
-
-
Method Details
-
blendToKinematicMode
public void blendToKinematicMode(float blendInterval, com.jme3.math.Transform endModelTransform) Begin blending this link to a purely kinematic mode.- Parameters:
blendInterval
- the duration of the blend interval (in seconds, ≥0)endModelTransform
- the desired local transform for the attached model the blend completes or null for no change to local transform (unaffected)
-
getAttachedModel
public com.jme3.scene.Spatial getAttachedModel()Access the attached model (not the attachment node).- Returns:
- the pre-existing instance (not null)
-
release
public void release()Release the attached model. The link must already be in dynamic mode and cannot have been previously released. -
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 attached model 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
- true→force to kinematic mode, false→preserve mode
-
isReleased
public boolean isReleased()Test whether the attached model has been released.- Overrides:
isReleased
in classPhysicsLink
- Returns:
- true if released, otherwise false
-
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)
-
physicsTransform
public final com.jme3.math.Transform physicsTransform(com.jme3.math.Transform storeResult) Calculate a physics transform for the rigid body.- Overrides:
physicsTransform
in classPhysicsLink
- 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)
-
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
-
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
-