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

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:12

Methods

loadModel

loadModel(model): void

Loads the model in the helper

Parameters

NameTypeDescription
modelObject3D<Event, string>3D model to use

Returns

void

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:23


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>

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:47


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>

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:63


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>

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:82


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

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:134


update

update(): boolean

Update loop to update the mixer

Returns

boolean

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:148

Accessors

getMixer

get getMixer(): AnimationMixer

Returns mixer of the model

Returns

AnimationMixer

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:32


getAnimationClips

get getAnimationClips(): AnimationClip[]

Returns animation clips of the model

Returns

AnimationClip[]

Defined in

webgi/src/helpers/threejs/CustomAnimationHelper.ts:39