t3d. 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
clipt3d.KeyframeClipThe keyframe clip for this action.

Extends

Members

blendMode :t3d.BLEND_TYPE

The blend mode for this action, currently only two values BLEND_TYPE.NORMAL and BLEND_TYPE.ADD are available.
Default Value
  • {t3d.BLEND_TYPE.NORMAL}

clip :t3d.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, thisObjectopt)

Adds a listener to an event type.
Parameters:
NameTypeAttributesDefaultDescription
typeStringThe type of event to listen to.
listenerfunctionThe function that gets called when the event is fired.
thisObjectObject<optional>
thisThe Object of calling listener method.

dispatchEvent(event)

Fire an event.
Parameters:
NameTypeDescription
eventObjectThe event that gets fired.

removeEventListener(type, listener, thisObjectopt)

Removes a listener from an event type.
Parameters:
NameTypeAttributesDefaultDescription
typeStringThe type of the listener that gets removed.
listenerfunctionThe listener function that gets removed.
thisObjectObject<optional>
thisthisObject - The Object of calling listener method.

update(deltaTime)

Update time.
Parameters:
NameTypeDescription
deltaTimeNumberThe delta time in seconds.