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.
Constructor
Variables
Methods
update():Void
Computes the world transform using the parent bone and this bone's local applied transform.
updateWorldTransform():Void
Computes the world transform using the parent bone and this bone's local transform.
See {@link #updateWorldTransformWithData(float, float, float, float, float, float, float)}.
updateWorldTransformWithData(x:Float, y:Float, rotation:Float, scaleX:Float, scaleY:Float, shearX:Float, shearY:Float):Void
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.
isActive():Bool
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.
updateAppliedTransform():Void
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.
getA():Float
Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called.
getB():Float
Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called.
getC():Float
Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called.
getD():Float
Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called.
getWorldX():Float
The world X position. If changed, {@link #updateAppliedTransform()} should be called.
getWorldY():Float
The world Y position. If changed, {@link #updateAppliedTransform()} should be called.
getWorldRotationX():Float
The world rotation for the X axis, calculated using {@link #a} and {@link #c}.
getWorldRotationY():Float
The world rotation for the Y axis, calculated using {@link #b} and {@link #d}.
getWorldScaleX():Float
The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}.
getWorldScaleY():Float
The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}.
worldToLocal(world:Vector2):Vector2
Transforms a point from world coordinates to the bone's local coordinates.
localToWorld(local:Vector2):Vector2
Transforms a point from the bone's local coordinates to world coordinates.
rotateWorld(degrees:Float):Void
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.