Class for representing the armatures in three.js. The skeleton is defined by a hierarchy of bones.
Example:
val bones = js.Array[Bone]()
val shoulder = new Bone()
val elbow = new Bone()
val hand = new Bone()
shoulder.add(elbow)
elbow.add(hand)
bones.push(shoulder, elbow, hand)
shoulder.position.y = -5
elbow.position.y = 0
hand.position.y = 5
val armSkeleton = new Skeleton(bones)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Anyclass Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Computes the bone inverse matrices. This method resets boneInverses and fills it with new matrices.
Computes the bone inverse matrices. This method resets boneInverses and fills it with new matrices.
Attributes
Returns a new skeleton with copied values from this instance.
Returns a new skeleton with copied values from this instance.
Attributes
- Definition Classes
-
Object
Computes a data texture for passing bone data to the vertex shader.
Computes a data texture for passing bone data to the vertex shader.
Attributes
Frees the GPU-related resources allocated by this instance.
Frees the GPU-related resources allocated by this instance.
Attributes
Setups the skeleton by the given JSON and bones.
Setups the skeleton by the given JSON and bones.
Value parameters
- bones
-
An object map of bones
- json
-
The skeleton as serialized JSON
Attributes
- Returns
-
A reference of this instance
Searches through the skeleton's bone array and returns the first with a matching name.
Searches through the skeleton's bone array and returns the first with a matching name.
Value parameters
- name
-
The name of the bone
Attributes
- Returns
-
The found bone, undefined if no bone has been found
Initializes the skeleton. This method gets automatically called by the constructor but depending on how the skeleton is created it might be necessary to call this method manually.
Initializes the skeleton. This method gets automatically called by the constructor but depending on how the skeleton is created it might be necessary to call this method manually.
Attributes
Resets the skeleton to the base pose.
Resets the skeleton to the base pose.
Attributes
Serializes the skeleton into JSON.
Serializes the skeleton into JSON.
Attributes
Updates the skeleton bone matrices.
Updates the skeleton bone matrices.
Attributes
Inherited methods
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Concrete fields
An array of bone inverse matrices.
An array of bone inverse matrices.
Attributes
A texture holding the bone data for use in the vertex shader.
A texture holding the bone data for use in the vertex shader.
Attributes
The UUID of this skeleton instance.
The UUID of this skeleton instance.