Documentation / scene / Skeleton
Class: Skeleton
Defined in: libs/scene/src/animation/skeleton.ts:1696
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:1697
Parameters
joints
inverseBindMatrices
Matrix4x4[]
bindPose
Returns
Skeleton
Overrides
Properties
tryExtractHumanoidJoints
statictryExtractHumanoidJoints: <T>(root) =>HumanoidJointMapping<T> =SkinBinding.tryExtractHumanoidJoints
Defined in: libs/scene/src/animation/skeleton.ts:1701
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
An object containing the mapped body and hand joints if a complete humanoid rig is detected, otherwise null.
Overrides
SkinBinding.tryExtractHumanoidJoints
tryExtractHumanoidJointsMixamo
statictryExtractHumanoidJointsMixamo: <T>(root) =>HumanoidJointMapping<T> =SkinBinding.tryExtractHumanoidJointsMixamo
Defined in: libs/scene/src/animation/skeleton.ts:1702
Type Parameters
T
T extends object
Parameters
root
T
Returns
Overrides
SkinBinding.tryExtractHumanoidJointsMixamo
tryExtractHumanoidJointsVRM
statictryExtractHumanoidJointsVRM: <T>(root) =>HumanoidJointMapping<T> =SkinBinding.tryExtractHumanoidJointsVRM
Defined in: libs/scene/src/animation/skeleton.ts:1703
Type Parameters
T
T extends object
Parameters
root
T
Returns
Overrides
SkinBinding.tryExtractHumanoidJointsVRM
tryExtractHumanoidJointsUnityHumanoid
statictryExtractHumanoidJointsUnityHumanoid: <T>(root) =>HumanoidJointMapping<T> =SkinBinding.tryExtractHumanoidJointsUnityHumanoid
Defined in: libs/scene/src/animation/skeleton.ts:1704
Type Parameters
T
T extends object
Parameters
root
T
Returns
Overrides
SkinBinding.tryExtractHumanoidJointsUnityHumanoid
tryExtractHumanoidJointsBiped
statictryExtractHumanoidJointsBiped: <T>(root) =>HumanoidJointMapping<T> =SkinBinding.tryExtractHumanoidJointsBiped
Defined in: libs/scene/src/animation/skeleton.ts:1705
Type Parameters
T
T extends object
Parameters
root
T
Returns
Overrides
SkinBinding.tryExtractHumanoidJointsBiped
Accessors
disposed
Get Signature
get disposed():
boolean
Defined in: libs/base/dist/index.d.ts:6065
Returns
boolean
Inherited from
rig
Get Signature
get rig():
SkeletonRig
Defined in: libs/scene/src/animation/skeleton.ts:468
Returns
Inherited from
joints
Get Signature
get joints():
SceneNode[]
Defined in: libs/scene/src/animation/skeleton.ts:472
Gets joint nodes
Returns
Inherited from
humanoidJointMapping
Get Signature
get humanoidJointMapping():
HumanoidJointMapping<SceneNode>
Defined in: libs/scene/src/animation/skeleton.ts:476
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:480
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:491
Returns
boolean
Set Signature
set playing(
b):void
Defined in: libs/scene/src/animation/skeleton.ts:494
Parameters
b
boolean
Returns
void
Inherited from
persistentId
Get Signature
get persistentId():
string
Defined in: libs/scene/src/animation/skeleton.ts:497
Returns
string
Set Signature
set persistentId(
val):void
Defined in: libs/scene/src/animation/skeleton.ts:500
Parameters
val
string
Returns
void
Inherited from
jointTexture
Get Signature
get jointTexture():
Texture2D<unknown>
Defined in: libs/scene/src/animation/skeleton.ts:516
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
modifiers
Get Signature
get modifiers():
SkeletonModifier[]
Defined in: libs/scene/src/animation/skeleton.ts:606
Get all modifiers attached to this skeleton.
Returns
Inherited from
Methods
on()
on<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:594
IEventTarget.on
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
once()
once<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:598
IEventTarget.once
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
off()
off<
K>(type,listener?,context?):void
Defined in: libs/base/dist/index.d.ts:602
IEventTarget.off
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener?
EventListener<{ dispose: []; }>
context?
unknown
Returns
void
Inherited from
dispatchEvent()
dispatchEvent<
K>(type, ...args):void
Defined in: libs/base/dist/index.d.ts:606
IEventTarget.dispatchEvent
Type Parameters
K
K extends "dispose"
Parameters
type
K
args
...object[K]
Returns
void
Inherited from
dispose()
dispose():
void
Defined in: libs/base/dist/index.d.ts:6066
Returns
void
Inherited from
getJointIndex()
getJointIndex(
joint):number
Defined in: libs/scene/src/animation/skeleton.ts:524
Get joint index by joint node
Parameters
joint
joint node
Returns
number
The index of the joint
Inherited from
getJointIndexByName()
getJointIndexByName(
jointName):number
Defined in: libs/scene/src/animation/skeleton.ts:532
Get joint index by joint name
Parameters
jointName
string
joint name
Returns
number
The index of the joint
Inherited from
SkinBinding.getJointIndexByName
onDispose()
protectedonDispose():void
Defined in: libs/scene/src/animation/skeleton.ts:656
Dispose GPU resources and references held by the skeleton.
- Disposes the joint texture.
- Clears matrix arrays and joint references.
Returns
void
Inherited from
getBoundingInfo()
getBoundingInfo(
data):SkinnedBoundingBox
Defined in: libs/scene/src/animation/skeleton.ts:714
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
Returns
Skinned bounding box info used during per-frame updates.
Inherited from
findSkeletonById()
staticfindSkeletonById(id):SkinBinding
Defined in: libs/scene/src/animation/skeleton.ts:1706
Parameters
id
string