Skeleton
An armature defined by a hierarchy of Bone objects. Used by SkinnedMesh for skeletal animation.
Constructor
const skeleton = new Skeleton(bones?, boneInverses?)
If boneInverses is omitted, they are computed automatically.
Properties
uuid— UUID stringbones—Array<Bone>boneInverses—Array<Matrix4>(inverse bind matrices)boneMatrices—Float32Array(flattened bone data)boneTexture—DataTexture(bone data for GPU, ornull)
Methods
init()— Initialize bone matrices (called by constructor)calculateInverses()— Recompute inverse bind matrices from current bone world matricespose()— Reset to bind poseupdate()— Flatten current bone transforms intoboneMatricescomputeBoneTexture()— Create GPU data texture for bone matricesgetBoneByName(name)— Find bone by namedispose()— Free GPU resourcesclone()— Clone skeletontoJSON()/fromJSON(json, bones)— Serialization
Usage
const bones = [shoulder, elbow, hand]
shoulder.add(elbow)
elbow.add(hand)
const skeleton = new Skeleton(bones)