AnimationAction

AnimationAction wraps AnimationClip and is mainly responsible for the update logic of time. You can extend other functions by inheriting this class, such as repeat playback, pingpang, etc. And since this class inherits from EventDispatcher, animation events can also be extended.

Constructor

new AnimationAction(clip)

Parameters:
NameTypeDescription
clipKeyframeClip

The keyframe clip for this action.

Extends

Members

blendMode :BLEND_TYPE

The blend mode for this action, currently only two values BLEND_TYPE.NORMAL and BLEND_TYPE.ADD are available.

Default Value
  • {BLEND_TYPE.NORMAL}

clip :KeyframeClip

The keyframe clip for this action.

time :number

The local time of this action (in seconds).

Type:
  • number

weight :number

The degree of influence of this action (in the interval [0, 1]). Values can be used to blend between several actions.

Type:
  • number
Default Value
  • 0

Methods

addEventListener(type, listener)

Adds a listener to an event type.

Parameters:
NameTypeDescription
typestring

The type of event to listen to.

listenerfunction

The function that gets called when the event is fired.

dispatchEvent(event)

Fire an event.

Parameters:
NameTypeDescription
eventobject

The event that gets fired.

removeEventListener(type, listener)

Removes a listener from an event type.

Parameters:
NameTypeDescription
typestring

The type of the listener that gets removed.

listenerfunction

The listener function that gets removed.

update(deltaTime)

Update time.

Parameters:
NameTypeDescription
deltaTimenumber

The delta time in seconds.