Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AnimationGroup

Use this class to create coordinated animations on multiple targets

Hierarchy

  • AnimationGroup

Implements

Index

Constructors

constructor

Properties

metadataSearch playground for metadata

metadata: any

Gets or sets an object used to store user defined information for the node

nameSearch playground for name

name: string

The name of the animation group

onAnimationEndObservableSearch playground for onAnimationEndObservable

onAnimationEndObservable: Observable<TargetedAnimation>

This observable will notify when one animation have ended

onAnimationGroupEndObservableSearch playground for onAnimationGroupEndObservable

onAnimationGroupEndObservable: Observable<AnimationGroup>

This observable will notify when all animations have ended.

onAnimationGroupLoopObservableSearch playground for onAnimationGroupLoopObservable

onAnimationGroupLoopObservable: Observable<AnimationGroup>

Observer raised when all animations have looped

onAnimationGroupPauseObservableSearch playground for onAnimationGroupPauseObservable

onAnimationGroupPauseObservable: Observable<AnimationGroup>

This observable will notify when all animations have paused.

onAnimationGroupPlayObservableSearch playground for onAnimationGroupPlayObservable

onAnimationGroupPlayObservable: Observable<AnimationGroup>

This observable will notify when all animations are playing.

onAnimationLoopObservableSearch playground for onAnimationLoopObservable

onAnimationLoopObservable: Observable<TargetedAnimation>

Observer raised when one animation loops

uniqueIdSearch playground for uniqueId

uniqueId: number

Gets or sets the unique id of the node

Accessors

animatables

  • returning the list of animatables controlled by this animation group.

    Returns Array<Animatable>

children

  • Gets the list of target animations

    Returns TargetedAnimation[]

from

  • get from(): number
  • Gets the first frame

    Returns number

isAdditive

  • get isAdditive(): boolean
  • set isAdditive(value: boolean): any
  • Gets or sets if all animations should be evaluated additively

    Returns boolean

  • Gets or sets if all animations should be evaluated additively

    Parameters

    • value: boolean

    Returns any

isPlaying

  • get isPlaying(): boolean
  • Gets a value indicating that the current group is playing

    Returns boolean

isStarted

  • get isStarted(): boolean
  • Define if the animations are started

    Returns boolean

loopAnimation

  • get loopAnimation(): boolean
  • set loopAnimation(value: boolean): any
  • Gets or sets if all animations should loop or not

    Returns boolean

  • Gets or sets if all animations should loop or not

    Parameters

    • value: boolean

    Returns any

speedRatio

  • get speedRatio(): number
  • set speedRatio(value: number): any
  • Gets or sets the speed ratio to use for all animations

    Returns number

  • Gets or sets the speed ratio to use for all animations

    Parameters

    • value: number

    Returns any

targetedAnimations

  • Gets the targeted animations for this animation group

    Returns Array<TargetedAnimation>

to

  • get to(): number
  • Gets the last frame

    Returns number

Methods

addTargetedAnimationSearch playground for 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 TargetedAnimation object

cloneSearch playground for clone

  • clone(newName: string, targetConverter?: (oldTarget: any) => any, cloneAnimations?: boolean): AnimationGroup
  • Clone the current animation group and returns a copy

    Parameters

    • newName: string

      defines the name of the new group

    • Optional targetConverter: (oldTarget: any) => any

      defines an optional function used to convert current animation targets to new ones

        • (oldTarget: any): any
        • Parameters

          • oldTarget: any

          Returns any

    • Optional cloneAnimations: boolean

      defines if the animations should be cloned or referenced

    Returns AnimationGroup

    the new animation group

disposeSearch playground for dispose

  • dispose(): void
  • Dispose all associated resources

    Returns void

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Returns the string "AnimationGroup"

    Returns string

    "AnimationGroup"

goToFrameSearch playground for goToFrame

  • Goes to a specific frame in this animation group

    Parameters

    • frame: number

      the frame number to go to

    Returns AnimationGroup

    the animationGroup

normalizeSearch playground for 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

    the animation group

pauseSearch playground for pause

  • Pause all animations

    Returns AnimationGroup

    the animation group

playSearch playground for 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

    the animation group

resetSearch playground for reset

  • Reset all animations to initial state

    Returns AnimationGroup

    the animation group

restartSearch playground for restart

  • Restart animations from key 0

    Returns AnimationGroup

    the animation group

serializeSearch playground for serialize

  • serialize(): any
  • Serializes the animationGroup to an object

    Returns any

    Serialized object

setWeightForAllAnimatablesSearch playground for setWeightForAllAnimatables

startSearch playground for start

  • start(loop?: boolean, speedRatio?: number, from?: number, to?: number, isAdditive?: boolean): 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)

    • Optional isAdditive: boolean

      defines the additive state for the resulting animatables (optional)

    Returns AnimationGroup

    the current animation group

stopSearch playground for stop

  • Stop all animations

    Returns AnimationGroup

    the animation group

syncAllAnimationsWithSearch playground for syncAllAnimationsWith

toStringSearch playground for toString

  • toString(fullDetails?: boolean): string
  • Creates a detailed string about the object

    Parameters

    • Optional fullDetails: boolean

      defines if the output string will support multiple levels of logging within scene loading

    Returns string

    a string representing the object

Static MakeAnimationAdditiveSearch playground for MakeAnimationAdditive

  • MakeAnimationAdditive(sourceAnimationGroup: AnimationGroup, referenceFrame?: number, range?: string, cloneOriginal?: boolean, clonedName?: string): AnimationGroup
  • Convert the keyframes for all animations belonging to the group to be relative to a given reference frame.

    Parameters

    • sourceAnimationGroup: AnimationGroup

      defines the AnimationGroup containing animations to convert

    • Optional referenceFrame: number

      defines the frame that keyframes in the range will be relative to

    • Optional range: string

      defines the name of the AnimationRange belonging to the animations in the group to convert

    • Optional cloneOriginal: boolean

      defines whether or not to clone the group and convert the clone or convert the original group (default is false)

    • Optional clonedName: string

      defines the name of the resulting cloned AnimationGroup if cloneOriginal is true

    Returns AnimationGroup

    a new AnimationGroup if cloneOriginal is true or the original AnimationGroup if cloneOriginal is false

Static ParseSearch playground for Parse

  • Returns a new AnimationGroup object parsed from the source provided.

    Parameters

    • parsedAnimationGroup: any

      defines the source

    • scene: Scene

      defines the scene that will receive the animationGroup

    Returns AnimationGroup

    a new AnimationGroup

Legend

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