AnimationGroup

Use this class to create coordinated animations on multiple targets

Hierarchy

  • AnimationGroup

Implements

Index

Constructors

constructor

Properties

animatables

animatables: Array<Animatable>

returning the list of animatables controlled by this animation group.

from

from: number

Gets the first frame

isStarted

isStarted: boolean

Define if the animations are started

name

name: string

onAnimationEndObservable

onAnimationEndObservable: Observable<TargetedAnimation>

onAnimationGroupEndObservable

onAnimationGroupEndObservable: Observable<AnimationGroup>

This observable will notify when all animations have ended.

speedRatio

speedRatio: number

Gets or sets the speed ratio to use for all animations

targetedAnimations

targetedAnimations: Array<TargetedAnimation>

Gets the targeted animations for this animation group

to

to: number

Gets the last frame

Methods

addTargetedAnimation

  • Add an animation (with its target) in the group

    Parameters

    • animation: Animation

      defines the animation we want to add

    • target: any

      defines the target of the animation

    Returns TargetedAnimation

    the {BABYLON.TargetedAnimation} object

dispose

  • dispose(): void

goToFrame

  • Goes to a specific frame in this animation group

    Parameters

    • frame: number

      the frame number to go to

    Returns AnimationGroup

    the animationGroup

normalize

  • This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame It can add constant keys at begin or end

    Parameters

    • Optional beginFrame: Nullable<number>

      defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)

    • Optional endFrame: Nullable<number>

      defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)

    Returns AnimationGroup

pause

play

  • Play all animations to initial state This function will start() the animations if they were not started or will restart() them if they were paused

    Parameters

    • Optional loop: boolean

      defines if animations must loop

    Returns AnimationGroup

reset

restart

setWeightForAllAnimatables

start

  • start(loop?: boolean, speedRatio?: number, from?: number, to?: number): AnimationGroup
  • Start all animations on given targets

    Parameters

    • Optional loop: boolean

      defines if animations must loop

    • Optional speedRatio: number

      defines the ratio to apply to animation speed (1 by default)

    • Optional from: number

      defines the from key (optional)

    • Optional to: number

      defines the to key (optional)

    Returns AnimationGroup

    the current animation group

stop

syncAllAnimationsWith

Generated using TypeDoc