Skeleton

Use an array of bones to create a skeleton that can be used by a SkinnedMesh.

Example

// Create a simple "arm" var bones = []; var shoulder = new v3d.Bone(); var elbow = new v3d.Bone(); var hand = new v3d.Bone(); shoulder.add(elbow); elbow.add(hand); bones.push(shoulder); bones.push(elbow); bones.push(hand); shoulder.position.y = -5; elbow.position.y = 0; hand.position.y = 5; var armSkeleton = new v3d.Skeleton(bones);

See the SkinnedMesh page for an example of usage with standard BufferGeometry.

Constructor

Skeleton(bones : Array, boneInverses : Array)

bones - The array of bones. Default is an empty array.
boneInverses - (optional) An array of Matrix4s.

Creates a new Skeleton.

Properties

.bones : Array

The array of bones. Note this is a copy of the original array, not a reference, so you can modify the original array without effecting this one.

.boneInverses : Array

An array of Matrix4s that represent the inverse of the matrixWorld of the individual bones.

.boneMatrices : Float32Array

The array buffer holding the bone data when using a vertex texture.

.boneTexture : DataTexture

The DataTexture holding the bone data when using a vertex texture.

Methods

.clone () : Skeleton

Returns a clone of this Skeleton object.

.calculateInverses () : null

Generates the boneInverses array if not provided in the constructor.

.pose () : null

Returns the skeleton to the base pose.

.update () : null

Updates the boneMatrices and boneTexture after changing the bones. This is called automatically by the WebGLRenderer if the skeleton is used with a SkinnedMesh.

.getBoneByName (name : String) : Bone

name -- String to match to the Bone's .name property.

Searches through the skeleton's bone array and returns the first with a matching name.

Source

For more info on how to obtain the source code of this module see this page.