Bone
spine.Bone (Class)
Stores a bone's current pose.
A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
constraint or application code modifies the world transform after it was computed from the local transform.
Instance Members
Computes the world transform using the parent bone and this bone's local applied transform.
Computes the world transform using the parent bone and this bone's local transform.
See {@link #updateWorldTransformWithData(float, float, float, float, float, float, float)}.
Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the
specified local transform. Child bones are not updated.
See World transforms in the Spine
Runtimes Guide.
spine
setToSetupPose(): Void
Sets this bone's local transform to the setup pose.
The bone's setup pose data.
The skeleton this bone belongs to.
The parent bone, or null if this is the root bone.
The immediate children of this bone.
Returns false when the bone has not been computed because {@link BoneData#getSkinRequired()} is true and the
{@link Skeleton#getSkin() active skin} does not {@link Skin#getBones() contain} this bone.
The local x translation.
The local y translation.
spine
getRotation(): Float
The local rotation in degrees, counter clockwise.
The local scaleX.
The local scaleY.
The local shearX.
The local shearY.
The applied local x translation.
The applied local y translation.
spine
getARotation(): Float
The applied local rotation in degrees, counter clockwise.
Name |
Type |
arotation |
Float |
The applied local scaleX.
The applied local scaleY.
The applied local shearX.
The applied local shearY.
Computes the applied transform values from the world transform.
If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so
the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply another
constraint).
Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after
calling this method is equivalent to the local transform used to compute the world transform, but may not be identical.
Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called.
Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called.
Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called.
Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called.
The world X position. If changed, {@link #updateAppliedTransform()} should be called.
The world Y position. If changed, {@link #updateAppliedTransform()} should be called.
spine
getWorldRotationX(): Float
The world rotation for the X axis, calculated using {@link #a} and {@link #c}.
spine
getWorldRotationY(): Float
The world rotation for the Y axis, calculated using {@link #b} and {@link #d}.
spine
getWorldScaleX(): Float
The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}.
spine
getWorldScaleY(): Float
The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}.
Transforms a point from world coordinates to the bone's local coordinates.
Transforms a point from the bone's local coordinates to world coordinates.
spine
worldToLocalRotation(worldRotation: Float): Float
Transforms a world rotation to a local rotation.
Name |
Type |
worldRotation |
Float |
spine
localToWorldRotation(localRotation: Float): Float
Transforms a local rotation to a world rotation.
Name |
Type |
localRotation |
Float |
Rotates the world transform the specified amount.
After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and {@link #update()} will
need to be called on any child bones, recursively.