API

Class Skeleton

Class used to handle skinning animations

Implements

Index
animations: Animation[]

Gets the list of animations attached to this skeleton

bones: Bone[] = []

Defines the list of child bones

dimensionsAtRest: Vector3

Defines an estimate of the dimension of the skeleton at rest

doNotSerialize: boolean = false

Specifies if the skeleton should be serialized

id: string

defines the skeleton Id

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

metadata: any = null

Gets or sets an object used to store user defined information for the skeleton

name: string

defines the skeleton name

needInitialSkinMatrix: boolean = false

Defines a boolean indicating if the root matrix is provided by meshes or by the current skeleton (this is the default value)

onBeforeComputeObservable: Observable<Skeleton> = ...

An observable triggered before computing the skeleton's matrices

  • get useTextureToStoreBoneMatrices(): boolean

    Gets or sets a boolean indicating that bone matrices should be stored as a texture instead of using shader uniforms (default is true). Please note that this option is not available if the hardware does not support it

    Returns boolean

  • set useTextureToStoreBoneMatrices(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • Begin a specific animation range

    Parameters

    • name: string

      defines the name of the range to start

    • Optionalloop: boolean

      defines if looping must be turned on (false by default)

    • OptionalspeedRatio: number

      defines the speed ratio to apply (1 by default)

    • OptionalonAnimationEnd: () => void

      defines a callback which will be called when animation will end

    Returns Nullable<Animatable>

    a new animatable

  • Compute all node absolute matrices

    Parameters

    • forceUpdate: boolean = false

      defines if computation must be done even if cache is up to date

    Returns void

  • Compute all node absolute matrices

    Parameters

    • forceUpdate: boolean = false

      defines if computation must be done even if cache is up to date

    Returns void

    Please use computeAbsoluteMatrices instead

  • Copy animation range from a source skeleton. This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences

    Parameters

    • source: Skeleton

      defines the source skeleton

    • name: string

      defines the name of the range to copy

    • rescaleAsRequired: boolean = false

      defines if rescaling must be applied if required

    Returns boolean

    true if operation was successful

  • Create a new animation range

    Parameters

    • name: string

      defines the name of the range

    • from: number

      defines the start key

    • to: number

      defines the end key

    Returns void

  • Delete a specific animation range

    Parameters

    • name: string

      defines the name of the range

    • deleteFrames: boolean = true

      defines if frames must be removed as well

    Returns void

  • Finds a bone in a skeleton that is linked to the given transform node.

    Parameters

    • transformNode: TransformNode

      The transform node to find the bone for

    Returns Bone | null

    The bone linked to the transform node, or null if not found

  • Finds a bone in a skeleton by the name of its linked transform node.

    Parameters

    • name: string

      The name of the linked transform node

    Returns Bone | null

    The bone linked to the transform node with the given name, or null if not found

  • Get bone's index searching by name

    Parameters

    • name: string

      defines bone's name to search for

    Returns number

    the indice of the bone. Returns -1 if not found

  • Build all resources required to render a skeleton

    Parameters

    • dontCheckFrameId: boolean = false

      defines a boolean indicating if prepare should be run without checking first the current frame id (default: false)

    Returns void

  • Gets a string representing the current skeleton data

    Parameters

    • OptionalfullDetails: boolean

      defines a boolean indicating if we want a verbose version

    Returns string

    a string representing the current skeleton data

  • Convert the keyframes for a range of animation on a skeleton to be relative to a given reference frame.

    Parameters

    • skeleton: Skeleton

      defines the Skeleton containing the animation range to convert

    • referenceFrame: number = 0

      defines the frame that keyframes in the range will be relative to

    • range: string

      defines the name of the AnimationRange belonging to the Skeleton to convert

    Returns Nullable<Skeleton>

    the original skeleton