Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to store an actual running animation

Hierarchy

  • Animatable

Index

Constructors

  • new Animatable(scene: Scene, target: any, fromFrame?: number, toFrame?: number, loopAnimation?: boolean, speedRatio?: number, onAnimationEnd?: Nullable<(() => void)>, animations?: Animation[], onAnimationLoop?: Nullable<(() => void)>, isAdditive?: boolean, playOrder?: number): Animatable
  • Creates a new Animatable

    Parameters

    • scene: Scene

      defines the hosting scene

    • target: any

      defines the target object

    • Optional fromFrame: number

      defines the starting frame number (default is 0)

    • Optional toFrame: number

      defines the ending frame number (default is 100)

    • Optional loopAnimation: boolean

      defines if the animation must loop (default is false)

    • Optional speedRatio: number

      defines the factor to apply to animation speed (default is 1)

    • Optional onAnimationEnd: Nullable<(() => void)>

      defines a callback to call when animation ends if it is not looping

    • Optional animations: Animation[]

      defines a group of animation to add to the new Animatable

    • Optional onAnimationLoop: Nullable<(() => void)>

      defines a callback to call when animation loops

    • Optional isAdditive: boolean

      defines whether the animation should be evaluated additively

    • Optional playOrder: number

      defines the order in which this animatable should be processed in the list of active animatables (default: 0)

    Returns Animatable

Properties

animationStarted: boolean

Gets a boolean indicating if the animation has started

disposeOnEnd: boolean

Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation. This will only apply for non looping animation (default is true)

fromFrame: number

defines the starting frame number (default is 0)

isAdditive: boolean

defines whether the animation should be evaluated additively

loopAnimation: boolean

defines if the animation must loop (default is false)

onAnimationEnd?: Nullable<(() => void)>

defines a callback to call when animation ends if it is not looping

onAnimationEndObservable: Observable<Animatable>

Observer raised when the animation ends

onAnimationLoop?: Nullable<(() => void)>

defines a callback to call when animation loops

onAnimationLoopObservable: Observable<Animatable>

Observer raised when the animation loops

playOrder: number

defines the order in which this animatable should be processed in the list of active animatables (default: 0)

target: any

defines the target object

toFrame: number

defines the ending frame number (default is 100)

Accessors

  • get elapsedTime(): number
  • Gets the elapsed time since the animatable started in milliseconds

    Returns number

  • get masterFrame(): number
  • Gets the current frame of the first RuntimeAnimation Used to synchronize Animatables

    Returns number

  • get paused(): boolean
  • Returns true if the animations for this animatable are paused

    Returns boolean

  • get speedRatio(): number
  • set speedRatio(value: number): void
  • Gets or sets the speed ratio to apply to the animatable (1.0 by default)

    Returns number

  • Gets or sets the speed ratio to apply to the animatable (1.0 by default)

    Parameters

    • value: number

    Returns void

  • Gets the root Animatable used to synchronize and normalize animations

    Returns Nullable<Animatable>

  • get weight(): number
  • set weight(value: number): void
  • Gets or sets the animatable weight (-1.0 by default meaning not weighted)

    Returns number

  • Gets or sets the animatable weight (-1.0 by default meaning not weighted)

    Parameters

    • value: number

    Returns void

Methods

  • appendAnimations(target: any, animations: Animation[]): void
  • Adds more animations to the current animatable

    Parameters

    • target: any

      defines the target of the animations

    • animations: Animation[]

      defines the new animations to add

    Returns void

  • disableBlending(): void
  • enableBlending(blendingSpeed: number): void
  • Gets the source animation for a specific property

    Parameters

    • property: string

      defines the property to look for

    Returns Nullable<Animation>

    null or the source animation for the given property

  • Gets the list of runtime animations

    Returns RuntimeAnimation[]

    an array of RuntimeAnimation

  • Gets the runtime animation for a specific property

    Parameters

    • property: string

      defines the property to look for

    Returns Nullable<RuntimeAnimation>

    null or the runtime animation for the given property

  • goToFrame(frame: number): void
  • Jump directly to a given frame

    Parameters

    • frame: number

      defines the frame to jump to

    Returns void

  • pause(): void
  • Pause the animation

    Returns void

  • reset(): void
  • Resets the animatable to its original state

    Returns void

  • restart(): void
  • Restart the animation

    Returns void

  • stop(animationName?: string, targetMask?: ((target: any) => boolean), useGlobalSplice?: boolean): void
  • Stop and delete the current animation

    Parameters

    • Optional animationName: string

      defines a string used to only stop some of the runtime animations instead of all

    • Optional targetMask: ((target: any) => boolean)

      a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)

        • (target: any): boolean
        • Parameters

          • target: any

          Returns boolean

    • Optional useGlobalSplice: boolean

      if true, the animatables will be removed by the caller of this function (false by default)

    Returns void

  • Synchronize and normalize current Animatable with a source Animatable This is useful when using animation weights and when animations are not of the same length

    Parameters

    • root: Nullable<Animatable>

      defines the root Animatable to synchronize with (null to stop synchronizing)

    Returns Animatable

    the current Animatable

  • Wait asynchronously for the animation to end

    Returns Promise<Animatable>

    a promise which will be fulfilled when the animation ends

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme