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

public class BoneLink extends PhysicsLink
Link an animated bone in an Armature/Skeleton to a jointed rigid body in a ragdoll.
  • Field Details

    • logger2

      public static final Logger logger2
      message logger for this class
  • Constructor Details

    • BoneLink

      protected BoneLink()
      No-argument constructor needed by SavableClassUtil.
  • Method Details

    • blendToKinematicMode

      public void blendToKinematicMode(KinematicSubmode submode, float blendInterval)
      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-axis
      lockY - true to lock the joint's Y-axis
      lockZ - 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 to Reset 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

      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 linked bone's transform based on the transform of the 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
    • 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)
    • 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
    • setDynamic

      public void setDynamic(com.jme3.math.Vector3f uniformAcceleration)
      Immediately put this link into dynamic mode. The control must be "ready".
      Overrides:
      setDynamic in class PhysicsLink
      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 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