Class Bone
- All Implemented Interfaces:
Savable
,JmeCloneable
,Cloneable
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Add a new child to this bone.void
cloneFields
(Cloner cloner, Object original) Deprecated.Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner.Deprecated.Deprecated.Returns the bind position expressed in local space (relative to the parent bone).Deprecated.Returns the bind rotation expressed in local space (relative to the parent bone).Deprecated.Returns the bind scale expressed in local space (relative to the parent bone).Deprecated.Returns all the children bones of this bone.getCombinedTransform
(Vector3f position, Quaternion rotation) Deprecated.Returns the local transform of this bone combined with the given position and rotationDeprecated.Returns the local position of the bone, relative to the parent bone.Deprecated.Returns the local rotation of the bone, relative to the parent bone.Deprecated.Returns the local scale of the bone, relative to the parent bone.Deprecated.Returns the inverse Bind position of this bone expressed in model space.Deprecated.Returns the inverse bind rotation of this bone expressed in model space.Deprecated.Returns the inverse world bind pose scale.Deprecated.Deprecated.Returns the position of the bone in model space.Deprecated.Returns the rotation of the bone in model space.Deprecated.Returns the scale of the bone in model space.getName()
Deprecated.Returns the name of the bone, set in the constructor.Deprecated.Returns parent bone of this bone, or null if it is a root bone.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.usegetBindScale()
boolean
Deprecated.returns true if this bone can be directly manipulated by the user.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 the local bind transform of the bone.void
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
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.toString()
Deprecated.final void
update()
Deprecated.Updates world transforms for this bone and its children.final void
Deprecated.Updates the model transforms for this bone and, possibly, the attachments node if not null.final void
Deprecated.void
write
(JmeExporter ex) Deprecated.
-
Field Details
-
SAVABLE_VERSION
public static final int SAVABLE_VERSIONDeprecated.- See Also:
-
-
Constructor Details
-
Bone
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
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 interfaceJmeCloneable
- Returns:
- a new instance
-
cloneFields
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 interfaceJmeCloneable
- 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
Deprecated.Returns the name of the bone, set in the constructor.- Returns:
- The name of the bone, set in the constructor.
-
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
Deprecated.Returns all the children bones of this bone.- Returns:
- All the children bones of this bone.
-
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
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
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
Deprecated.Returns the position of the bone in model space.- Returns:
- The position of the bone in model space.
-
getModelSpaceRotation
Deprecated.Returns the rotation of the bone in model space.- Returns:
- The rotation of the bone in model space.
-
getModelSpaceScale
Deprecated.Returns the scale of the bone in model space.- Returns:
- The scale of the bone in model space.
-
getWorldBindInversePosition
Deprecated.- Returns:
- the pre-existing vector
-
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.- Returns:
- the pre-existing 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.- Returns:
- the pre-existing vector
-
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
Deprecated. -
getBindInverseTransform
Deprecated. -
getWorldBindPosition
Deprecated.- Returns:
- the pre-existing vector
-
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.- Returns:
- the pre-existing 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.usegetBindScale()
- Returns:
- the pre-existing vector
-
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
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. -
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
Deprecated.Sets the transforms of this bone in local space (relative to the parent bone)- Parameters:
translation
- the translation in local spacerotation
- the rotation in local spacescale
- the scale in local space
-
setUserTransformsInModelSpace
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 spacerotation
- rotation in model space
-
getCombinedTransform
Deprecated.Returns the local transform of this bone combined with the given position and rotation- Parameters:
position
- a positionrotation
- a rotation- Returns:
- the resulting Transform (in reusable temporary storage!)
-
setBindTransforms
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
Deprecated. -
read
Deprecated.- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
write
Deprecated.- Specified by:
write
in interfaceSavable
- Throws:
IOException
-
setLocalRotation
Deprecated.Sets the rotation of the bone in object space. Warning: you need to callsetUserControl(boolean)
with true to be able to do that operation- Parameters:
rot
- the desired rotation (not null, unaffected)
-
setLocalTranslation
Deprecated.Sets the position of the bone in object space. Warning: you need to callsetUserControl(boolean)
with true to be able to do that operation- Parameters:
pos
- the desired translation (not null, unaffected)
-
setLocalScale
Deprecated.Sets the scale of the bone in object space. Warning: you need to callsetUserControl(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:
-
Joint