Joint
@Deprecated public final class Bone extends java.lang.Object implements Savable, JmeCloneable
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.Modifier and Type | Field and Description |
---|---|
static int |
SAVABLE_VERSION
Deprecated.
|
Modifier | Constructor and Description |
---|---|
protected |
Bone()
Deprecated.
Serialization only.
|
|
Bone(java.lang.String name)
Deprecated.
Creates a new bone with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Bone bone)
Deprecated.
Add a new child to this bone.
|
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Deprecated.
Implemented to perform deep cloning for this object, resolving
local cloned references using the specified cloner.
|
Transform |
getBindInverseTransform()
Deprecated.
|
Vector3f |
getBindPosition()
Deprecated.
Returns the bind position expressed in local space (relative to the parent bone).
|
Quaternion |
getBindRotation()
Deprecated.
Returns the bind rotation expressed in local space (relative to the parent bone).
|
Vector3f |
getBindScale()
Deprecated.
Returns the bind scale expressed in local space (relative to the parent bone).
|
java.util.ArrayList<Bone> |
getChildren()
Deprecated.
Returns all the children bones of this bone.
|
Transform |
getCombinedTransform(Vector3f position,
Quaternion rotation)
Deprecated.
Returns the local transform of this bone combined with the given position and rotation
|
Vector3f |
getLocalPosition()
Deprecated.
Returns the local position of the bone, relative to the parent bone.
|
Quaternion |
getLocalRotation()
Deprecated.
Returns the local rotation of the bone, relative to the parent bone.
|
Vector3f |
getLocalScale()
Deprecated.
Returns the local scale of the bone, relative to the parent bone.
|
Vector3f |
getModelBindInversePosition()
Deprecated.
Returns the inverse Bind position of this bone expressed in model space.
|
Quaternion |
getModelBindInverseRotation()
Deprecated.
Returns the inverse bind rotation of this bone expressed in model space.
|
Vector3f |
getModelBindInverseScale()
Deprecated.
Returns the inverse world bind pose scale.
|
Transform |
getModelBindInverseTransform()
Deprecated.
|
Vector3f |
getModelSpacePosition()
Deprecated.
Returns the position of the bone in model space.
|
Quaternion |
getModelSpaceRotation()
Deprecated.
Returns the rotation of the bone in model space.
|
Vector3f |
getModelSpaceScale()
Deprecated.
Returns the scale of the bone in model space.
|
java.lang.String |
getName()
Deprecated.
Returns the name of the bone, set in the constructor.
|
Bone |
getParent()
Deprecated.
Returns parent bone of this bone, or null if it is a root bone.
|
Vector3f |
getWorldBindInversePosition()
Deprecated.
|
Quaternion |
getWorldBindInverseRotation()
Deprecated.
|
Vector3f |
getWorldBindInverseScale()
Deprecated.
|
Vector3f |
getWorldBindPosition()
Deprecated.
|
Quaternion |
getWorldBindRotation()
Deprecated.
|
Vector3f |
getWorldBindScale()
Deprecated.
use
getBindScale() |
boolean |
hasUserControl()
Deprecated.
returns true if this bone can be directly manipulated by the user.
|
java.lang.Object |
jmeClone()
Deprecated.
Performs a regular shallow clone of the object.
|
void |
read(JmeImporter im)
Deprecated.
|
void |
setBindTransforms(Vector3f translation,
Quaternion rotation,
Vector3f scale)
Deprecated.
Sets local bind transform for bone.
|
void |
setLocalRotation(Quaternion rot)
Deprecated.
Sets the rotation of the bone in object space.
|
void |
setLocalScale(Vector3f scale)
Deprecated.
Sets the scale of the bone in object space.
|
void |
setLocalTranslation(Vector3f pos)
Deprecated.
Sets the position of the bone in object space.
|
void |
setUserControl(boolean enable)
Deprecated.
If enabled, user can control bone transform with setUserTransforms.
|
void |
setUserTransforms(Vector3f translation,
Quaternion rotation,
Vector3f scale)
Deprecated.
Sets the transforms of this bone in local space (relative to the parent bone)
|
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.
|
void |
setUserTransformsWorld(Vector3f translation,
Quaternion rotation)
|
java.lang.String |
toString()
Deprecated.
|
void |
update()
Deprecated.
Updates world transforms for this bone and its children.
|
void |
updateModelTransforms()
Deprecated.
Updates the model transforms for this bone, and, possibly the attach node
if not null.
|
void |
updateWorldVectors()
Deprecated.
|
void |
write(JmeExporter ex)
Deprecated.
|
public static final int SAVABLE_VERSION
public Bone(java.lang.String name)
name
- Name to give to this boneprotected Bone()
public java.lang.Object jmeClone()
JmeCloneable
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.
jmeClone
in interface JmeCloneable
public void cloneFields(Cloner cloner, java.lang.Object original)
JmeCloneable
Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
cloneFields
in interface JmeCloneable
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 merely clone what it wants.public java.lang.String getName()
public Bone getParent()
public java.util.ArrayList<Bone> getChildren()
public Vector3f getLocalPosition()
public Quaternion getLocalRotation()
public Vector3f getLocalScale()
public Vector3f getModelSpacePosition()
public Quaternion getModelSpaceRotation()
public Vector3f getModelSpaceScale()
@Deprecated public Vector3f getWorldBindInversePosition()
getModelBindInversePosition()
public Vector3f getModelBindInversePosition()
The inverse bind pose transform of the bone in model space is its "default" transform with no animation applied.
@Deprecated public Quaternion getWorldBindInverseRotation()
getModelBindInverseRotation()
public Quaternion getModelBindInverseRotation()
The inverse bind pose transform of the bone in model space is its "default" transform with no animation applied.
@Deprecated public Vector3f getWorldBindInverseScale()
getModelBindInverseScale()
public Vector3f getModelBindInverseScale()
The inverse bind pose transform of the bone in model space is its "default" transform with no animation applied.
public Transform getModelBindInverseTransform()
public Transform getBindInverseTransform()
@Deprecated public Vector3f getWorldBindPosition()
getBindPosition()
public Vector3f getBindPosition()
The bind pose transform of the bone in local space is its "default" transform with no animation applied.
@Deprecated public Quaternion getWorldBindRotation()
getBindRotation()
public Quaternion getBindRotation()
The bind pose transform of the bone in local space is its "default" transform with no animation applied.
@Deprecated public Vector3f getWorldBindScale()
getBindScale()
public Vector3f getBindScale()
The bind pose transform of the bone in local space is its "default" transform with no animation applied.
public void setUserControl(boolean enable)
public void addChild(Bone bone)
bone
- The bone to add@Deprecated public final void updateWorldVectors()
updateModelTransforms()
public final void updateModelTransforms()
The model transform of this bone is computed by combining the parent's model transform with this bones' local transform.
public final void update()
public void setUserTransforms(Vector3f translation, Quaternion rotation, Vector3f scale)
translation
- the translation in local spacerotation
- the rotation in local spacescale
- the scale in local space@Deprecated public void setUserTransformsWorld(Vector3f translation, Quaternion rotation)
translation
- -rotation
- -public void setUserTransformsInModelSpace(Vector3f translation, Quaternion rotation)
translation
- translation in model spacerotation
- rotation in model spacepublic Transform getCombinedTransform(Vector3f position, Quaternion rotation)
position
- a positionrotation
- a rotationpublic void setBindTransforms(Vector3f translation, Quaternion rotation, Vector3f scale)
public java.lang.String toString()
toString
in class java.lang.Object
public void read(JmeImporter im) throws java.io.IOException
public void write(JmeExporter ex) throws java.io.IOException
public void setLocalRotation(Quaternion rot)
setUserControl(boolean)
with true to be able to do that operationrot
- public void setLocalTranslation(Vector3f pos)
setUserControl(boolean)
with true to be able to do that operationpos
- public void setLocalScale(Vector3f scale)
setUserControl(boolean)
with true to be able to do that operationscale
- the scale to applypublic boolean hasUserControl()
setUserControl(boolean)