Skip to main content

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

NameTypeDescription
modelObject3D<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

NameTypeDescription
loopbooleandefault 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

NameTypeDescription
loopbooleandefault 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

NameTypeDefault valueDescription
clipAnimationClipundefinedAnimation Clip of the 3D model that needs to be played
loopbooleanundefineddefault is 'false', if the clip needs to be looped continously then set it to 'true'
timescalenumber1timescale of the animation clip that will played. Default is 1
reversebooleanfalseto reverse the clip set it to true. Default is false
resetTimebooleanfalseresets 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

NameTypeDefault valueDescription
namestringundefinedname of the animation clip that is present in 3D model
loopfalseundefineddefault is 'false', if the clip needs to be looped continously then set it to 'true'
timescalenumber1timescale of the animation clip that will played. Default is 1
reversebooleanfalseto 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[]