Skip to content

Documentation / scene / Skeleton

Class: Skeleton ​

Defined in: libs/scene/src/animation/skeleton.ts:1830

Legacy compatibility name for a skin binding.

New code should use SkeletonRig for the shared animated rig and SkinBinding for per-skin inverse bind matrices.

Extends ​

Constructors ​

Constructor ​

new Skeleton(joints, inverseBindMatrices, bindPose): Skeleton

Defined in: libs/scene/src/animation/skeleton.ts:1831

Parameters ​

joints ​

SceneNode[]

inverseBindMatrices ​

Matrix4x4[]

bindPose ​

SkeletonBindPose[]

Returns ​

Skeleton

Overrides ​

SkinBinding.constructor

Properties ​

tryExtractHumanoidJoints ​

static tryExtractHumanoidJoints: <T>(root) => HumanoidJointMapping<T> = SkinBinding.tryExtractHumanoidJoints

Defined in: libs/scene/src/animation/skeleton.ts:1835

Attempt to extract humanoid joint mappings from the skeleton's joints based on their names.

This method looks for joints with names matching the standardized HumanoidBodyRig and HumanoidHandRig enums. If a complete mapping is found, it returns an object containing the mapped joints for the body and hands. If any required joint is missing, it returns null.

This method tries to find the best match for humanoid rigs, designed to work with Mixamo, VRoid, Unity Humanoid, Biped, and similar skeletons. It is not guaranteed to work with all models, and may require manual adjustments or custom modifiers for non-standard rigs.

Type Parameters ​

T ​

T extends object

Parameters ​

root ​

T

The root scene node to search for humanoid joints.

Returns ​

HumanoidJointMapping<T>

An object containing the mapped body and hand joints if a complete humanoid rig is detected, otherwise null.

Overrides ​

SkinBinding.tryExtractHumanoidJoints


tryExtractHumanoidJointsMixamo ​

static tryExtractHumanoidJointsMixamo: <T>(root) => HumanoidJointMapping<T> = SkinBinding.tryExtractHumanoidJointsMixamo

Defined in: libs/scene/src/animation/skeleton.ts:1836

Type Parameters ​

T ​

T extends object

Parameters ​

root ​

T

Returns ​

HumanoidJointMapping<T>

Overrides ​

SkinBinding.tryExtractHumanoidJointsMixamo


tryExtractHumanoidJointsVRM ​

static tryExtractHumanoidJointsVRM: <T>(root) => HumanoidJointMapping<T> = SkinBinding.tryExtractHumanoidJointsVRM

Defined in: libs/scene/src/animation/skeleton.ts:1837

Type Parameters ​

T ​

T extends object

Parameters ​

root ​

T

Returns ​

HumanoidJointMapping<T>

Overrides ​

SkinBinding.tryExtractHumanoidJointsVRM


tryExtractHumanoidJointsUnityHumanoid ​

static tryExtractHumanoidJointsUnityHumanoid: <T>(root) => HumanoidJointMapping<T> = SkinBinding.tryExtractHumanoidJointsUnityHumanoid

Defined in: libs/scene/src/animation/skeleton.ts:1838

Type Parameters ​

T ​

T extends object

Parameters ​

root ​

T

Returns ​

HumanoidJointMapping<T>

Overrides ​

SkinBinding.tryExtractHumanoidJointsUnityHumanoid


tryExtractHumanoidJointsBiped ​

static tryExtractHumanoidJointsBiped: <T>(root) => HumanoidJointMapping<T> = SkinBinding.tryExtractHumanoidJointsBiped

Defined in: libs/scene/src/animation/skeleton.ts:1839

Type Parameters ​

T ​

T extends object

Parameters ​

root ​

T

Returns ​

HumanoidJointMapping<T>

Overrides ​

SkinBinding.tryExtractHumanoidJointsBiped

Accessors ​

disposed ​

Get Signature ​

get disposed(): boolean

Defined in: libs/base/dist/index.d.ts:6107

Returns ​

boolean

Inherited from ​

SkinBinding.disposed


rig ​

Get Signature ​

get rig(): SkeletonRig

Defined in: libs/scene/src/animation/skeleton.ts:500

Returns ​

SkeletonRig

Inherited from ​

SkinBinding.rig


joints ​

Get Signature ​

get joints(): SceneNode[]

Defined in: libs/scene/src/animation/skeleton.ts:504

Gets joint nodes

Returns ​

SceneNode[]

Inherited from ​

SkinBinding.joints


humanoidJointMapping ​

Get Signature ​

get humanoidJointMapping(): HumanoidJointMapping<SceneNode>

Defined in: libs/scene/src/animation/skeleton.ts:508

Gets the humanoid joint mapping

Returns ​

HumanoidJointMapping<SceneNode>

Inherited from ​

SkinBinding.humanoidJointMapping


humanoidRootRotation ​

Get Signature ​

get humanoidRootRotation(): Quaternion

Defined in: libs/scene/src/animation/skeleton.ts:512

Root rotation of humanoid hips bone

Returns ​

Quaternion

Inherited from ​

SkinBinding.humanoidRootRotation


playing ​

Get Signature ​

get playing(): boolean

Defined in: libs/scene/src/animation/skeleton.ts:523

Returns ​

boolean

Set Signature ​

set playing(b): void

Defined in: libs/scene/src/animation/skeleton.ts:526

Parameters ​
b ​

boolean

Returns ​

void

Inherited from ​

SkinBinding.playing


persistentId ​

Get Signature ​

get persistentId(): string

Defined in: libs/scene/src/animation/skeleton.ts:529

Returns ​

string

Set Signature ​

set persistentId(val): void

Defined in: libs/scene/src/animation/skeleton.ts:532

Parameters ​
val ​

string

Returns ​

void

Inherited from ​

SkinBinding.persistentId


jointTexture ​

Get Signature ​

get jointTexture(): Texture2D<unknown>

Defined in: libs/scene/src/animation/skeleton.ts:548

Texture containing joint matrices for GPU skinning.

Each matrix is stored in 4 texels (one row per texel, RGBA = 4 floats).

Returns ​

Texture2D<unknown>

Inherited from ​

SkinBinding.jointTexture


modifiers ​

Get Signature ​

get modifiers(): SkeletonModifier[]

Defined in: libs/scene/src/animation/skeleton.ts:638

Get all modifiers attached to this skeleton.

Returns ​

SkeletonModifier[]

Inherited from ​

SkinBinding.modifiers

Methods ​

on() ​

on<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:630

IEventTarget.on

Type Parameters ​

K ​

K extends "dispose"

Parameters ​

type ​

K

listener ​

EventListener<{ dispose: []; }, K>

context? ​

unknown

Returns ​

void

Inherited from ​

SkinBinding.on


once() ​

once<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:634

IEventTarget.once

Type Parameters ​

K ​

K extends "dispose"

Parameters ​

type ​

K

listener ​

EventListener<{ dispose: []; }, K>

context? ​

unknown

Returns ​

void

Inherited from ​

SkinBinding.once


off() ​

off<K>(type, listener?, context?): void

Defined in: libs/base/dist/index.d.ts:638

IEventTarget.off

Type Parameters ​

K ​

K extends "dispose"

Parameters ​

type ​

K

listener? ​

EventListener<{ dispose: []; }>

context? ​

unknown

Returns ​

void

Inherited from ​

SkinBinding.off


dispatchEvent() ​

dispatchEvent<K>(type, ...args): void

Defined in: libs/base/dist/index.d.ts:642

IEventTarget.dispatchEvent

Type Parameters ​

K ​

K extends "dispose"

Parameters ​

type ​

K

args ​

...object[K]

Returns ​

void

Inherited from ​

SkinBinding.dispatchEvent


dispose() ​

dispose(): void

Defined in: libs/base/dist/index.d.ts:6108

Returns ​

void

Inherited from ​

SkinBinding.dispose


getJointIndex() ​

getJointIndex(joint): number

Defined in: libs/scene/src/animation/skeleton.ts:556

Get joint index by joint node

Parameters ​

joint ​

SceneNode

joint node

Returns ​

number

The index of the joint

Inherited from ​

SkinBinding.getJointIndex


getJointIndexByName() ​

getJointIndexByName(jointName): number

Defined in: libs/scene/src/animation/skeleton.ts:564

Get joint index by joint name

Parameters ​

jointName ​

string

joint name

Returns ​

number

The index of the joint

Inherited from ​

SkinBinding.getJointIndexByName


onDispose() ​

protected onDispose(): void

Defined in: libs/scene/src/animation/skeleton.ts:693

Dispose GPU resources and references held by the skeleton.

  • Disposes the joint texture.
  • Clears matrix arrays and joint references.

Returns ​

void

Inherited from ​

SkinBinding.onDispose


getBoundingInfo() ​

getBoundingInfo(data): SkinnedBoundingBox

Defined in: libs/scene/src/animation/skeleton.ts:751

Build representative skinned bounding data for a submesh.

Strategy:

  • For all vertices, compute their skinned position (using current ring buffer slot).
  • Track the indices of the min/max extents along x, y, z (6 indices total).
  • Store:
    • The 6 representative positions in object space.
    • Their 4 joint indices and weights (flattened).
    • An empty BoundingBox to be filled during animation.

Parameters ​

data ​
positions ​

Float32Array

blendIndices ​

TypedArray

weights ​

TypedArray

influenceCount? ​

number

Returns ​

SkinnedBoundingBox

Skinned bounding box info used during per-frame updates.

Inherited from ​

SkinBinding.getBoundingInfo


findSkeletonById() ​

static findSkeletonById(id): SkinBinding

Defined in: libs/scene/src/animation/skeleton.ts:1840

Parameters ​

id ​

string

Returns ​

SkinBinding

Overrides ​

SkinBinding.findSkeletonById

Released under the MIT License.