Animation
Wrapper around a native animation.
- Animation
- .constructor(engine, index) ⇒ Animation
- .duration
- .trackCount
- .equals(otherAnimation) ⇒ boolean
- .retarget(newTargets) ⇒ Animation
.constructor(engine: WonderlandEngine, index: number) ⇒ Animation
Param | Type | Description |
---|---|---|
engine | WonderlandEngine | |
index | number | Index in the manager |
.duration: number
Duration of this animation.
.trackCount: number
Number of tracks in this animation.
.equals(otherAnimation: undefined | null | Animation) ⇒ boolean
1.0.0+Checks equality by comparing whether the wrapped native animation ids are equal.
Returns: Whether this animation equals the given animation.
Param | Type | Description |
---|---|---|
otherAnimation | undefined | null | Animation | Animation to check equality with. |
.retarget(newTargets: Object3D[] | Skin) ⇒ Animation
Clone this animation retargeted to a new set of objects.
The clone shares most of the data with the original and is therefore light-weight.
Experimental: This API might change in upcoming versions.
If retargeting to Skin, the join names will be used to determine a mapping from the previous skin to the new skin. The source skin will be retrieved from the first track in the animation that targets a joint.
Returns: The retargeted clone of this animation.
Param | Type | Description |
---|---|---|
newTargets | Object3D[] | Skin | New targets per track. Expected to have trackCount elements or to be a Skin. |