Header menu logo Nu

Bone Type

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.

Constructors

Constructor Description

Bone(data, skeleton, parent)

Full Usage: Bone(data, skeleton, parent)

Parameters:
data : BoneData
skeleton : Skeleton
parent : Bone

Bone(bone, skeleton, parent)

Full Usage: Bone(bone, skeleton, parent)

Parameters:

Copy constructor. Does not copy the Bone.Children bones.

bone : Bone
skeleton : Skeleton
parent : Bone

May be null.

Instance members

Instance member Description

this.A

Full Usage: this.A

Part of the world transform matrix for the X axis. If changed, Bone.UpdateAppliedTransform should be called.

this.AScaleX

Full Usage: this.AScaleX

The applied local scaleX.

this.AScaleY

Full Usage: this.AScaleY

The applied local scaleY.

this.AShearX

Full Usage: this.AShearX

The applied local shearX.

this.AShearY

Full Usage: this.AShearY

The applied local shearY.

this.AX

Full Usage: this.AX

The applied local x translation.

this.AY

Full Usage: this.AY

The applied local y translation.

this.Active

Full Usage: this.Active

Returns: bool
Modifiers: abstract
Returns: bool

this.AppliedRotation

Full Usage: this.AppliedRotation

The rotation, as calculated by any constraints.

this.B

Full Usage: this.B

Part of the world transform matrix for the Y axis. If changed, Bone.UpdateAppliedTransform should be called.

this.C

Full Usage: this.C

Part of the world transform matrix for the X axis. If changed, Bone.UpdateAppliedTransform should be called.

this.Children

Full Usage: this.Children

Returns: ExposedList<Bone>
Returns: ExposedList<Bone>

this.D

Full Usage: this.D

Part of the world transform matrix for the Y axis. If changed, Bone.UpdateAppliedTransform should be called.

this.Data

Full Usage: this.Data

Returns: BoneData
Returns: BoneData

this.Inherit

Full Usage: this.Inherit

Controls how parent world transforms affect this bone.

this.LocalToWorld

Full Usage: this.LocalToWorld

Parameters:
    localX : float32
    localY : float32
    worldX : byref<float32>
    worldY : byref<float32>

Transforms a point from the bone's local coordinates to world coordinates.

localX : float32
localY : float32
worldX : byref<float32>
worldY : byref<float32>

this.LocalToWorldRotation

Full Usage: this.LocalToWorldRotation

Parameters:
    localRotation : float32

Returns: float32

Transforms a local rotation to a world rotation.

localRotation : float32
Returns: float32

this.Parent

Full Usage: this.Parent

Returns: Bone
Returns: Bone

this.ParentToWorld

Full Usage: this.ParentToWorld

Parameters:
    parentX : float32
    parentY : float32
    worldX : byref<float32>
    worldY : byref<float32>

Transforms a point from the parent bone's coordinates to world coordinates.

parentX : float32
parentY : float32
worldX : byref<float32>
worldY : byref<float32>

this.RotateWorld

Full Usage: this.RotateWorld

Parameters:
    degrees : float32

Rotates the world transform the specified amount.

After changes are made to the world transform, Bone.UpdateAppliedTransform should be called and Bone.Update will need to be called on any child bones, recursively.

degrees : float32

this.Rotation

Full Usage: this.Rotation

The local rotation.

this.ScaleX

Full Usage: this.ScaleX

The local scaleX.

this.ScaleY

Full Usage: this.ScaleY

The local scaleY.

this.SetToSetupPose

Full Usage: this.SetToSetupPose

Sets this bone's local transform to the setup pose.

this.ShearX

Full Usage: this.ShearX

The local shearX.

this.ShearY

Full Usage: this.ShearY

The local shearY.

this.Skeleton

Full Usage: this.Skeleton

Returns: Skeleton
Returns: Skeleton

this.ToString

Full Usage: this.ToString

Returns: string
Modifiers: abstract
Returns: string

this.Update

Full Usage: this.Update

Parameters:
Modifiers: abstract

Computes the world transform using the parent bone and this bone's local applied transform.

physics : Physics

this.UpdateAppliedTransform

Full Usage: this.UpdateAppliedTransform

Computes the applied transform values from the world transform.

If the world transform is modified (by a constraint, Bone.RotateWorld, 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.

this.UpdateWorldTransform

Full Usage: this.UpdateWorldTransform

Computes the world transform using the parent bone and this bone's local transform.

this.UpdateWorldTransform

Full Usage: this.UpdateWorldTransform

Parameters:
    x : float32
    y : float32
    rotation : float32
    scaleX : float32
    scaleY : float32
    shearX : float32
    shearY : float32

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.

x : float32
y : float32
rotation : float32
scaleX : float32
scaleY : float32
shearX : float32
shearY : float32

this.WorldRotationX

Full Usage: this.WorldRotationX

Returns: float32

The world rotation for the X axis, calculated using Bone.a and Bone.c.

Returns: float32

this.WorldRotationY

Full Usage: this.WorldRotationY

Returns: float32

The world rotation for the Y axis, calculated using Bone.b and Bone.d.

Returns: float32

this.WorldScaleX

Full Usage: this.WorldScaleX

Returns: float32

Returns the magnitide (always positive) of the world scale X.

Returns: float32

this.WorldScaleY

Full Usage: this.WorldScaleY

Returns: float32

Returns the magnitide (always positive) of the world scale Y.

Returns: float32

this.WorldToLocal

Full Usage: this.WorldToLocal

Parameters:
    worldX : float32
    worldY : float32
    localX : byref<float32>
    localY : byref<float32>

Transforms a point from world coordinates to the bone's local coordinates.

worldX : float32
worldY : float32
localX : byref<float32>
localY : byref<float32>

this.WorldToLocalRotation

Full Usage: this.WorldToLocalRotation

Parameters:
    worldRotation : float32

Returns: float32

Transforms a world rotation to a local rotation.

worldRotation : float32
Returns: float32

this.WorldToParent

Full Usage: this.WorldToParent

Parameters:
    worldX : float32
    worldY : float32
    parentX : byref<float32>
    parentY : byref<float32>

Transforms a point from world coordinates to the parent bone's local coordinates.

worldX : float32
worldY : float32
parentX : byref<float32>
parentY : byref<float32>

this.WorldX

Full Usage: this.WorldX

The world X position. If changed, Bone.UpdateAppliedTransform should be called.

this.WorldY

Full Usage: this.WorldY

The world Y position. If changed, Bone.UpdateAppliedTransform should be called.

this.X

Full Usage: this.X

The local X translation.

this.Y

Full Usage: this.Y

The local Y translation.

Type something to start searching.