Skeleton class

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

// Create a simple "arm"

final bones = [];

final shoulder = Bone();
final elbow = Bone();
final hand = Bone();

shoulder.add( elbow );
elbow.add( hand );

bones.add( shoulder );
bones.add( elbow );
bones.add( hand );

shoulder.position.y = -5;
elbow.position.y = 0;
hand.position.y = 5;

final armSkeleton = Skeleton( bones );

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

Constructors

Skeleton([List<Bone>? bones, List<Matrix4>? boneInverses])
bones - The array of bones. Default is an empty array.

Properties

boneInverses ↔ List<Matrix4>
getter/setter pair
boneMatrices ↔ Float32List
latefinal
bones ↔ List<Bone>
getter/setter pair
boneTexture ↔ DataTexture?
getter/setter pair
boneTextureSize ↔ int
getter/setter pair
disposed ↔ bool
getter/setter pair
frame ↔ double
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uuid ↔ String
getter/setter pair

Methods

calculateInverses() → void
Generates the page:.boneInverses boneInverses array if not provided in the constructor.
clone() → Skeleton
Returns a clone of this Skeleton object.
computeBoneTexture() → Skeleton
Computes an instance of DataTexture in order to pass the bone data more efficiently to the shader. The texture is assigned to boneTexture.
dispose() → void
Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
fromJson(Map<String, dynamic> json, Map<String, Bone?> bones) → Skeleton
getBoneByName(String name) → Bone?
name - String to match to the Bone's .name property.
getValue(String name) → Float32List
init() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pose() → void
Returns the skeleton to the base pose.
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited
update() → void
Updates the boneMatrices and boneTexture after changing the bones. This is called automatically by the WebGLRenderer if the skeleton is used with a SkinnedMesh.

Operators

operator ==(Object other) → bool
The equality operator.
inherited