Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AnimationState

The AnimationState gives full control over animation playback process. In most cases the Animation Component is sufficient and easier to use. Use the AnimationState if you need full control.

Hierarchy

Index

Constructors

constructor

Properties

Private _allowLastFrame

_allowLastFrame: boolean = false

Private _blendStateBuffer

_blendStateBuffer: BlendStateBuffer | null = null

Private _blendStateWriters

_blendStateWriters: IBlendStateWriter[] = []

Private _clip

Private commonTargetStatuses

commonTargetStatuses: (null | { changed: boolean; target: IBufferedTarget })[] = []

May be null due to failed to initialize.

Private _currentFramePlayed

_currentFramePlayed: boolean = false

Mark whether the current frame is played. When set new time to animation state, we should ensure the frame at the specified time being played at next update.

Protected _curveLoaded

_curveLoaded: boolean = false

This field is only visible from within internal.

Private _delay

_delay: number = 0

Private _delayTime

_delayTime: number = 0

Private _ignoreIndex

_ignoreIndex: number = InvalidIndex

Private Optional _lastIterations

_lastIterations: undefined | number

Private _lastWrapInfo

_lastWrapInfo: WrappedInfo | null = null

Private _lastWrapInfoEvent

_lastWrapInfoEvent: WrappedInfo | null = null

Private _name

_name: string

Private _process

_process: process = this.process

Private _repeatCount

_repeatCount: number = 1

Private _samplerSharedGroups

_samplerSharedGroups: ISamplerSharedGroup[] = []

Private _target

_target: Node | null = null

Protected _targetNode

_targetNode: Node | null = null

This field is only visible from within internal.

Private _wrapMode

_wrapMode: WrapMode = WrapMode.Normal

Private _wrappedInfo

_wrappedInfo: WrappedInfo = new WrappedInfo()

duration

duration: number = 1

The iteration duration of this animation in seconds. (length)

readonly

frameRate

frameRate: number = 0

speed

speed: number = 1

The animation's playback speed. 1 is normal playback speed.

default:

1.0

time

time: number = 0

The current accumulated time of this animation in seconds.

default

0

weight

weight: number = 0

The weight.

Accessors

clip

current

  • get current(): number

curveLoaded

  • get curveLoaded(): boolean

delay

  • get delay(): number
  • set delay(value: number): void
  • The start delay which represents the number of seconds from an animation's start time to the start of the active interval.

    default

    0

    Returns number

  • The start delay which represents the number of seconds from an animation's start time to the start of the active interval.

    default

    0

    Parameters

    • value: number

    Returns void

isMotionless

  • get isMotionless(): boolean

isPaused

  • get isPaused(): boolean

isPlaying

  • get isPlaying(): boolean

length

  • get length(): number

name

  • get name(): string

ratio

  • get ratio(): number

repeatCount

  • get repeatCount(): number
  • set repeatCount(value: number): void
  • The animation's iteration count property.

    A real number greater than or equal to zero (including positive infinity) representing the number of times to repeat the animation node.

    Values less than zero and NaN values are treated as the value 1.0 for the purpose of timing model calculations.

    default

    1

    Returns number

  • The animation's iteration count property.

    A real number greater than or equal to zero (including positive infinity) representing the number of times to repeat the animation node.

    Values less than zero and NaN values are treated as the value 1.0 for the purpose of timing model calculations.

    default

    1

    Parameters

    • value: number

    Returns void

wrapMode

Methods

Private destroyBlendStateWriters

  • _destroyBlendStateWriters(): void

Private emit

  • emit(type: any, state: any): void

Private fireEvent

  • fireEvent(index: number): void

Private needReverse

  • needReverse(currentIterations: number): boolean

Private onPauseOrStop

  • _onPauseOrStop(): void

Private onReplayOrResume

  • _onReplayOrResume(): void

Protected sampleCurves

  • sampleCurves(ratio: number): void

Private sampleEvents

setEventTarget

  • setEventTarget(target: any): void

allowLastFrameEvent

  • allowLastFrameEvent(allowed: boolean): void
  • Whether LastFrame should be triggered.

    Parameters

    • allowed: boolean

      True if the last frame events may be triggered. This method is only used for internal purpose only.

    Returns void

Private cache

  • cache(frames: number): void

destroy

  • destroy(): void

emit

  • emit(...args: any[]): void
  • deprecated

    Since V1.1.1, animation states were no longer defined as event targets. To process animation events, use Animation instead.

    Parameters

    • Rest ...args: any[]

    Returns void

Private getWrappedInfo

initialize

off

  • off(type: string, callback: Function, target?: any): void
  • deprecated

    Since V1.1.1, animation states were no longer defined as event targets. To process animation events, use Animation instead.

    Parameters

    • type: string
    • callback: Function
    • Optional target: any

    Returns void

on

  • on(type: string, callback: Function, target?: any): null | void
  • deprecated

    Since V1.1.1, animation states were no longer defined as event targets. To process animation events, use Animation instead.

    Parameters

    • type: string
    • callback: Function
    • Optional target: any

    Returns null | void

Private onBlendFinished

  • onBlendFinished(): void

Protected onError

  • onError(message: string): void

Protected onPause

  • onPause(): void

Protected onPlay

  • onPlay(): void

Protected onResume

  • onResume(): void

Protected onStop

  • onStop(): void

once

  • once(type: string, callback: Function, target?: any): null | void
  • deprecated

    Since V1.1.1, animation states were no longer defined as event targets. To process animation events, use Animation instead.

    Parameters

    • type: string
    • callback: Function
    • Optional target: any

    Returns null | void

pause

  • pause(): void

play

  • play(): void

Private process

  • process(): void

resume

  • resume(): void

sample

setTime

  • setTime(time: number): void

Private simpleProcess

  • simpleProcess(): void

step

  • step(): void

stop

  • stop(): void

update

  • update(delta: number): void

Object literals

Private blendStateWriterHost

blendStateWriterHost: object

enabled

enabled: boolean = false

weight

weight: number = 0

Generated using TypeDoc