Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to handle skinning animations

see

https://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons

Hierarchy

  • Skeleton

Implements

Index

Constructors

  • Creates a new skeleton

    Parameters

    • name: string

      defines the skeleton name

    • id: string

      defines the skeleton Id

    • scene: Scene

      defines the hosting scene

    Returns Skeleton

Properties

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

Specifies if the skeleton should be serialized

id: string

defines the skeleton Id

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

see

https://doc.babylonjs.com/how_to/debug_layer#extensibility

name: string

defines the skeleton name

needInitialSkinMatrix: boolean

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

Accessors

  • get isUsingTextureForMatrices(): boolean
  • Gets a boolean indicating that the skeleton effectively stores matrices into a texture

    Returns boolean

  • get uniqueId(): number
  • Gets the unique ID of this skeleton

    Returns number

  • get useTextureToStoreBoneMatrices(): boolean
  • set useTextureToStoreBoneMatrices(value: boolean): void
  • 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

  • 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

    Parameters

    • value: boolean

    Returns void

Methods

  • beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Nullable<Animatable>
  • Begin a specific animation range

    Parameters

    • name: string

      defines the name of the range to start

    • Optional loop: boolean

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

    • Optional speedRatio: number

      defines the speed ratio to apply (1 by default)

    • Optional onAnimationEnd: () => void

      defines a callback which will be called when animation will end

        • (): void
        • Returns void

    Returns Nullable<Animatable>

    a new animatable

  • clone(name: string, id?: string): Skeleton
  • Clone the current skeleton

    Parameters

    • name: string

      defines the name of the new skeleton

    • Optional id: string

      defines the id of the new skeleton

    Returns Skeleton

    the new skeleton

  • computeAbsoluteTransforms(forceUpdate?: boolean): void
  • Compute all node absolute transforms

    Parameters

    • Optional forceUpdate: boolean

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

    Returns void

  • copyAnimationRange(source: Skeleton, name: string, rescaleAsRequired?: boolean): boolean
  • 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

    • Optional rescaleAsRequired: boolean

      defines if rescaling must be applied if required

    Returns boolean

    true if operation was successful

  • createAnimationRange(name: string, from: number, to: number): void
  • 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

  • deleteAnimationRange(name: string, deleteFrames?: boolean): void
  • Delete a specific animation range

    Parameters

    • name: string

      defines the name of the range

    • Optional deleteFrames: boolean

      defines if frames must be removed as well

    Returns void

  • dispose(): void
  • Releases all resources associated with the current skeleton

    Returns void

  • enableBlending(blendingSpeed?: number): void
  • Gets the list of animatables currently running for this skeleton

    Returns IAnimatable[]

    an array of animatables

  • Gets a specific animation range

    Parameters

    • name: string

      defines the name of the range to look for

    Returns Nullable<AnimationRange>

    the requested animation range or null if not found

  • Gets the list of all animation ranges defined on this skeleton

    Returns Nullable<AnimationRange>[]

    an array

  • getBoneIndexByName(name: string): number
  • 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

  • getChildren(): Bone[]
  • Returns an array containing the root bones

    Returns Bone[]

    an array containing the root bones

  • getClassName(): string
  • Gets the current object class name.

    Returns string

    the class name

  • Gets the root pose matrix

    Returns Nullable<Matrix>

    a matrix

  • Gets the current hosting scene

    Returns Scene

    a scene object

  • Gets the list of transform matrices to send to shaders (one matrix per bone)

    Parameters

    • mesh: AbstractMesh

      defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)

    Returns Float32Array

    a Float32Array containing matrices data

  • Gets the list of transform matrices to send to shaders inside a texture (one matrix per bone)

    Parameters

    • mesh: AbstractMesh

      defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)

    Returns Nullable<RawTexture>

    a raw texture containing the data

  • prepare(): void
  • Build all resources required to render a skeleton

    Returns void

  • returnToRest(): void
  • Forces the skeleton to go to rest pose

    Returns void

  • serialize(): any
  • Serialize the skeleton in a JSON object

    Returns any

    a JSON object

  • setCurrentPoseAsRest(): void
  • Set the current local matrix as the restPose for all bones in the skeleton.

    Returns void

  • sortBones(): void
  • Sorts bones per internal index

    Returns void

  • toString(fullDetails?: boolean): string
  • Gets a string representing the current skeleton data

    Parameters

    • Optional fullDetails: 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: undefined | number

      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

  • Creates a new skeleton from serialized data

    Parameters

    • parsedSkeleton: any

      defines the serialized data

    • scene: Scene

      defines the hosting scene

    Returns Skeleton

    a new skeleton

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited constructor
  • Static method

Settings

Theme