Animation

Wrapper around a native animation.

.constructor(engine: WonderlandEngine, index: number) ⇒ Animation 

ParamTypeDescription
engineWonderlandEngine
indexnumberIndex in the manager

.duration: number 

Duration of this animation.

.trackCount: number 

Number of tracks in this animation.

.equals(otherAnimation: undefined | null | Animation) ⇒ boolean 

0.8.5+

Checks equality by comparing whether the wrapped native animation ids are equal.

Returns: Whether this animation equals the given animation.

ParamTypeDescription
otherAnimationundefined | null | AnimationAnimation 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.

ParamTypeDescription
newTargetsObject3D[] | SkinNew targets per track. Expected to have trackCount elements or to be a Skin.