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

public class AttachmentLink extends PhysicsLink
Link an attachments node to a jointed rigid body in a ragdoll.
  • Field Details

    • logger2

      public static final Logger 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

      public void cloneFields(com.jme3.util.clone.Cloner cloner, Object original)
      Callback from Cloner 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 interface com.jme3.util.clone.JmeCloneable
      Overrides:
      cloneFields in class PhysicsLink
      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 class PhysicsLink
    • freeze

      public void freeze(boolean forceKinematic)
      Immediately freeze this link.
      Specified by:
      freeze in class PhysicsLink
      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 class PhysicsLink
      Returns:
      true if released, otherwise false
    • kinematicUpdate

      protected void kinematicUpdate(float tpf)
      Update this link in blended Kinematic mode.
      Overrides:
      kinematicUpdate in class PhysicsLink
      Parameters:
      tpf - the time interval between frames (in seconds, ≥0)
    • name

      public String name()
      Unambiguously identify this link by name, within its DynamicAnimControl.
      Specified by:
      name in class PhysicsLink
      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 class PhysicsLink
      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

      public void read(com.jme3.export.JmeImporter importer) throws IOException
      De-serialize this link from the specified importer, for example when loading from a J3O file.
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class PhysicsLink
      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 class PhysicsLink
    • write

      public void write(com.jme3.export.JmeExporter exporter) throws IOException
      Serialize this link to the specified exporter, for example when saving to a J3O file.
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class PhysicsLink
      Parameters:
      exporter - (not null)
      Throws:
      IOException - from the exporter