Class: CustomAnimationHelper
Extra-Helpers.CustomAnimationHelper
AnimationHelper is a helper class used by AnimationHelperPlugin that allows the extraction of all the animation clips and bind it with AnimationMixer For internal use only at the moment.
Constructors
constructor
• new CustomAnimationHelper()
Properties
mixer
• mixer: AnimationMixer
Animation mixer for a 3D model
Methods
loadModel
▸ loadModel(model): void
Loads the model in the helper
Parameters
| Name | Type | Description |
|---|---|---|
model | Object3D<Object3DEventMap> | 3D model to use |
Returns
void
playAllAnimations
▸ playAllAnimations(loop): Promise<void>
Plays all the animation clips that are present in the 3D model
Parameters
| Name | Type | Description |
|---|---|---|
loop | boolean | default is 'false', if the clip needs to be looped continously then set it to 'true' |
Returns
Promise<void>
reverseAllAnimation
▸ reverseAllAnimation(loop): Promise<void>
Reverses all the animation clips that are present in the 3D model
Parameters
| Name | Type | Description |
|---|---|---|
loop | boolean | default is 'false', if the clip needs to be looped continously then set it to 'true' |
Returns
Promise<void>
playClip
▸ playClip(clip, loop, timescale?, reverse?, resetTime?): Promise<void>
Plays the single clip from the Helper of a 3D model
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
clip | AnimationClip | undefined | Animation Clip of the 3D model that needs to be played |
loop | boolean | undefined | default is 'false', if the clip needs to be looped continously then set it to 'true' |
timescale | number | 1 | timescale of the animation clip that will played. Default is 1 |
reverse | boolean | false | to reverse the clip set it to true. Default is false |
resetTime | boolean | false | resets the mixer time. Default is false |
Returns
Promise<void>
playClipByName
▸ playClipByName(name, loop, timescale?, reverse?): void
Plays the clip by its name from the Helper of a 3D model
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
name | string | undefined | name of the animation clip that is present in 3D model |
loop | false | undefined | default is 'false', if the clip needs to be looped continously then set it to 'true' |
timescale | number | 1 | timescale of the animation clip that will played. Default is 1 |
reverse | boolean | false | to reverse the clip set it to true. Default is false |
Returns
void
update
▸ update(): boolean
Update loop to update the mixer
Returns
boolean
Accessors
getMixer
• get getMixer(): AnimationMixer
Returns mixer of the model
Returns
AnimationMixer
getAnimationClips
• get getAnimationClips(): AnimationClip[]
Returns animation clips of the model
Returns
AnimationClip[]