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
FieldsFields inherited from class com.jme3.bullet.animation.PhysicsLink
logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNo-argument constructor needed by SavableClassUtil. -
Method Summary
Modifier and TypeMethodDescriptionvoidblendToKinematicMode(float blendInterval, com.jme3.math.Transform endModelTransform) Begin blending this link to a purely kinematic mode.voidcloneFields(com.jme3.util.clone.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.protected voidUpdate this link in Dynamic mode, setting the local transform of the attached model based on the transform of the linked rigid body.voidfreeze(boolean forceKinematic) Immediately freeze this link.com.jme3.scene.SpatialAccess the attached model (not the attachment node).booleanTest whether the attached model has been released.protected voidkinematicUpdate(float tpf) Update this link in blended Kinematic mode.name()Unambiguously identify this link by name, within its DynamicAnimControl.final com.jme3.math.TransformphysicsTransform(com.jme3.math.Transform storeResult) Calculate a physics transform for the rigid body.voidread(com.jme3.export.JmeImporter importer) De-serialize this link from the specified importer, for example when loading from a J3O file.voidrelease()Release the attached model.voidImmediately put this link into ragdoll mode.voidwrite(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 fromClonerto convert this shallow-cloned link 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 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:
dynamicUpdatein classPhysicsLink
-
freeze
public void freeze(boolean forceKinematic) Immediately freeze this link.- Specified by:
freezein classPhysicsLink- Parameters:
forceKinematic- true→force to kinematic mode, false→preserve mode
-
isReleased
public boolean isReleased()Test whether the attached model has been released.- Overrides:
isReleasedin classPhysicsLink- Returns:
- true if released, otherwise false
-
kinematicUpdate
protected void kinematicUpdate(float tpf) Update this link in blended Kinematic mode.- Overrides:
kinematicUpdatein classPhysicsLink- Parameters:
tpf- the time interval between frames (in seconds, ≥0)
-
name
Unambiguously identify this link by name, within its DynamicAnimControl.- Specified by:
namein 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:
physicsTransformin 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:
readin interfacecom.jme3.export.Savable- Overrides:
readin 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:
setRagdollModein classPhysicsLink
-
write
Serialize this link to the specified exporter, for example when saving to a J3O file.- Specified by:
writein interfacecom.jme3.export.Savable- Overrides:
writein classPhysicsLink- Parameters:
exporter- (not null)- Throws:
IOException- from the exporter
-