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, java.lang.Cloneable

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

    Fields 
    Modifier and Type Field Description
    static java.util.logging.Logger logger2
    message logger for this class

    Fields inherited from class com.jme3.bullet.animation.PhysicsLink

    logger
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected BoneLink()
    No-argument constructor needed by SavableClassUtil.
  • Method Summary

    Modifier and Type Method Description
    void 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, java.lang.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.
    int countManaged()
    Determine the number of managed skeleton bones or armature joints.
    protected void dynamicUpdate()
    Update this link in Dynamic mode, setting the linked bone's transform based on the transform of the rigid body.
    com.jme3.math.Vector3f[] footprint()
    Estimate the footprint of this link.
    void freeze​(boolean forceKinematic)
    Immediately freeze this link.
    BoneLink jmeClone()
    Create a shallow clone for the JME cloner.
    protected void kinematicUpdate​(float tpf)
    Update this link in blended Kinematic mode.
    java.lang.String 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 setLocalTransform​(int mbIndex, com.jme3.math.Transform localTransform)
    Alter the local transform of the indexed managed bone.
    void setRagdollMode()
    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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger2

      public static final java.util.logging.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)
    • 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, java.lang.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
    • jmeClone

      public BoneLink jmeClone()
      Create a shallow clone for the JME cloner.
      Specified by:
      jmeClone in interface com.jme3.util.clone.JmeCloneable
      Overrides:
      jmeClone in class PhysicsLink
      Returns:
      a new instance
    • 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 java.lang.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 java.io.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:
      java.io.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 java.io.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:
      java.io.IOException - from the exporter