Class Bone

java.lang.Object
com.jme3.animation.Bone
All Implemented Interfaces:
Savable, JmeCloneable, Cloneable

@Deprecated public final class Bone extends Object implements Savable, JmeCloneable
Deprecated.
use Joint
Bone describes a bone in the bone-weight skeletal animation system. A bone contains a name and an index, as well as relevant transformation data. A bone has 3 sets of transforms : 1. The bind transforms, that are the transforms of the bone when the skeleton is in its rest pose (also called bind pose or T pose in the literature). The bind transforms are expressed in Local space meaning relatively to the parent bone. 2. The Local transforms, that are the transforms of the bone once animation or user transforms has been applied to the bind pose. The local transforms are expressed in Local space meaning relatively to the parent bone. 3. The Model transforms, that are the transforms of the bone relatives to the rootBone of the skeleton. Those transforms are what is needed to apply skinning to the mesh the skeleton controls. Note that there can be several rootBones in a skeleton. The one considered for these transforms is the one that is an ancestor of this bone.
  • Field Details

  • Constructor Details

    • Bone

      public Bone(String name)
      Deprecated.
      Creates a new bone with the given name.
      Parameters:
      name - Name to give to this bone
    • Bone

      protected Bone()
      Deprecated.
      Serialization only. Do not use.
  • Method Details

    • jmeClone

      public Object jmeClone()
      Deprecated.
      Description copied from interface: JmeCloneable
      Performs a regular shallow clone of the object. Some fields may also be cloned but generally only if they will never be shared with other objects. (For example, local Vector3fs and so on.)

      This method is separate from the regular clone() method so that objects might still maintain their own regular java clone() semantics (perhaps even using Cloner for those methods). However, because Java's clone() has specific features in the sense of Object's clone() implementation, it's usually best to have some path for subclasses to bypass the public clone() method that might be cloning fields and instead get at the superclass protected clone() methods. For example, through super.jmeClone() or another protected clone method that some base class eventually calls super.clone() in.

      Specified by:
      jmeClone in interface JmeCloneable
      Returns:
      a new instance
    • cloneFields

      public void cloneFields(Cloner cloner, Object original)
      Deprecated.
      Description copied from interface: JmeCloneable
      Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner. The object can call cloner.clone(fieldValue) to deep clone any of its fields.

      Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.

      Specified by:
      cloneFields in interface JmeCloneable
      Parameters:
      cloner - The cloner that is performing the cloning operation. The cloneFields method can call back into the cloner to make clones of its subordinate fields.
      original - The original object from which this object was cloned. This is provided for the very rare case that this object needs to refer to its original for some reason. In general, all of the relevant values should have been transferred during the shallow clone, and this object need only clone what it wants.
    • getName

      public String getName()
      Deprecated.
      Returns the name of the bone, set in the constructor.
      Returns:
      The name of the bone, set in the constructor.
    • getParent

      public Bone getParent()
      Deprecated.
      Returns parent bone of this bone, or null if it is a root bone.
      Returns:
      The parent bone of this bone, or null if it is a root bone.
    • getChildren

      public ArrayList<Bone> getChildren()
      Deprecated.
      Returns all the children bones of this bone.
      Returns:
      All the children bones of this bone.
    • getLocalPosition

      public Vector3f getLocalPosition()
      Deprecated.
      Returns the local position of the bone, relative to the parent bone.
      Returns:
      The local position of the bone, relative to the parent bone.
    • getLocalRotation

      public Quaternion getLocalRotation()
      Deprecated.
      Returns the local rotation of the bone, relative to the parent bone.
      Returns:
      The local rotation of the bone, relative to the parent bone.
    • getLocalScale

      public Vector3f getLocalScale()
      Deprecated.
      Returns the local scale of the bone, relative to the parent bone.
      Returns:
      The local scale of the bone, relative to the parent bone.
    • getModelSpacePosition

      public Vector3f getModelSpacePosition()
      Deprecated.
      Returns the position of the bone in model space.
      Returns:
      The position of the bone in model space.
    • getModelSpaceRotation

      public Quaternion getModelSpaceRotation()
      Deprecated.
      Returns the rotation of the bone in model space.
      Returns:
      The rotation of the bone in model space.
    • getModelSpaceScale

      public Vector3f getModelSpaceScale()
      Deprecated.
      Returns the scale of the bone in model space.
      Returns:
      The scale of the bone in model space.
    • getWorldBindInversePosition

      @Deprecated public Vector3f getWorldBindInversePosition()
      Returns:
      the pre-existing vector
    • getModelBindInversePosition

      public Vector3f getModelBindInversePosition()
      Deprecated.
      Returns the inverse Bind position of this bone expressed in model space.

      The inverse bind pose transform of the bone in model space is its "default" transform with no animation applied.

      Returns:
      the inverse bind position of this bone expressed in model space.
    • getWorldBindInverseRotation

      @Deprecated public Quaternion getWorldBindInverseRotation()
      Returns:
      the pre-existing Quaternion
    • getModelBindInverseRotation

      public Quaternion getModelBindInverseRotation()
      Deprecated.
      Returns the inverse bind rotation of this bone expressed in model space.

      The inverse bind pose transform of the bone in model space is its "default" transform with no animation applied.

      Returns:
      the inverse bind rotation of this bone expressed in model space.
    • getWorldBindInverseScale

      @Deprecated public Vector3f getWorldBindInverseScale()
      Returns:
      the pre-existing vector
    • getModelBindInverseScale

      public Vector3f getModelBindInverseScale()
      Deprecated.
      Returns the inverse world bind pose scale.

      The inverse bind pose transform of the bone in model space is its "default" transform with no animation applied.

      Returns:
      the inverse world bind pose scale.
    • getModelBindInverseTransform

      public Transform getModelBindInverseTransform()
      Deprecated.
    • getBindInverseTransform

      public Transform getBindInverseTransform()
      Deprecated.
    • getWorldBindPosition

      @Deprecated public Vector3f getWorldBindPosition()
      Deprecated.
      Returns:
      the pre-existing vector
    • getBindPosition

      public Vector3f getBindPosition()
      Deprecated.
      Returns the bind position expressed in local space (relative to the parent bone).

      The bind pose transform of the bone in local space is its "default" transform with no animation applied.

      Returns:
      the bind position in local space.
    • getWorldBindRotation

      @Deprecated public Quaternion getWorldBindRotation()
      Deprecated.
      Returns:
      the pre-existing Quaternion
    • getBindRotation

      public Quaternion getBindRotation()
      Deprecated.
      Returns the bind rotation expressed in local space (relative to the parent bone).

      The bind pose transform of the bone in local space is its "default" transform with no animation applied.

      Returns:
      the bind rotation in local space.
    • getWorldBindScale

      @Deprecated public Vector3f getWorldBindScale()
      Deprecated.
      Returns:
      the pre-existing vector
    • getBindScale

      public Vector3f getBindScale()
      Deprecated.
      Returns the bind scale expressed in local space (relative to the parent bone).

      The bind pose transform of the bone in local space is its "default" transform with no animation applied.

      Returns:
      the bind scale in local space.
    • setUserControl

      public void setUserControl(boolean enable)
      Deprecated.
      If enabled, user can control bone transform with setUserTransforms. Animation transforms are not applied to this bone when enabled.
      Parameters:
      enable - true for direct control, false for canned animations
    • addChild

      public void addChild(Bone bone)
      Deprecated.
      Add a new child to this bone. Shouldn't be used by user code. Can corrupt skeleton.
      Parameters:
      bone - The bone to add
    • updateWorldVectors

      @Deprecated public final void updateWorldVectors()
      Deprecated.
    • updateModelTransforms

      public final void updateModelTransforms()
      Deprecated.
      Updates the model transforms for this bone and, possibly, the attachments node if not null.

      The model transform of this bone is computed by combining the parent's model transform with this bone's local transform.

    • update

      public final void update()
      Deprecated.
      Updates world transforms for this bone and its children.
    • setUserTransforms

      public void setUserTransforms(Vector3f translation, Quaternion rotation, Vector3f scale)
      Deprecated.
      Sets the transforms of this bone in local space (relative to the parent bone)
      Parameters:
      translation - the translation in local space
      rotation - the rotation in local space
      scale - the scale in local space
    • setUserTransformsInModelSpace

      public void setUserTransformsInModelSpace(Vector3f translation, Quaternion rotation)
      Deprecated.
      Sets the transforms of this bone in model space (relative to the root bone) Must update all bones in skeleton for this to work.
      Parameters:
      translation - translation in model space
      rotation - rotation in model space
    • getCombinedTransform

      public Transform getCombinedTransform(Vector3f position, Quaternion rotation)
      Deprecated.
      Returns the local transform of this bone combined with the given position and rotation
      Parameters:
      position - a position
      rotation - a rotation
      Returns:
      the resulting Transform (in reusable temporary storage!)
    • setBindTransforms

      public void setBindTransforms(Vector3f translation, Quaternion rotation, Vector3f scale)
      Deprecated.
      Sets the local bind transform of the bone. Call setBindingPose() after all of the bones' bind transforms are set to save them.
      Parameters:
      translation - the desired bind translation (not null, unaffected)
      rotation - the desired bind rotation (not null, unaffected)
      scale - the desired bind scale (unaffected) or null for no scaling
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
    • read

      public void read(JmeImporter im) throws IOException
      Deprecated.
      Specified by:
      read in interface Savable
      Throws:
      IOException
    • write

      public void write(JmeExporter ex) throws IOException
      Deprecated.
      Specified by:
      write in interface Savable
      Throws:
      IOException
    • setLocalRotation

      public void setLocalRotation(Quaternion rot)
      Deprecated.
      Sets the rotation of the bone in object space. Warning: you need to call setUserControl(boolean) with true to be able to do that operation
      Parameters:
      rot - the desired rotation (not null, unaffected)
    • setLocalTranslation

      public void setLocalTranslation(Vector3f pos)
      Deprecated.
      Sets the position of the bone in object space. Warning: you need to call setUserControl(boolean) with true to be able to do that operation
      Parameters:
      pos - the desired translation (not null, unaffected)
    • setLocalScale

      public void setLocalScale(Vector3f scale)
      Deprecated.
      Sets the scale of the bone in object space. Warning: you need to call setUserControl(boolean) with true to be able to do that operation
      Parameters:
      scale - the scale to apply
    • hasUserControl

      public boolean hasUserControl()
      Deprecated.
      returns true if this bone can be directly manipulated by the user.
      Returns:
      true if it can be manipulated
      See Also: