Options
All
  • Public
  • Public/Protected
  • All
Menu

Use this class to create coordinated animations on multiple targets

Hierarchy

  • AnimationGroup

Implements

Index

Constructors

Properties

_parentContainer: Nullable<AbstractScene>
internal
metadata: any

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

name: string

The name of the animation group

onAnimationEndObservable: Observable<TargetedAnimation>

This observable will notify when one animation have ended

onAnimationGroupEndObservable: Observable<AnimationGroup>

This observable will notify when all animations have ended.

onAnimationGroupLoopObservable: Observable<AnimationGroup>

Observer raised when all animations have looped

onAnimationGroupPauseObservable: Observable<AnimationGroup>

This observable will notify when all animations have paused.

onAnimationGroupPlayObservable: Observable<AnimationGroup>

This observable will notify when all animations are playing.

onAnimationLoopObservable: Observable<TargetedAnimation>

Observer raised when one animation loops

uniqueId: number

Gets or sets the unique id of the node

Accessors

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

    Returns Animatable[]

  • Gets the list of target animations

    Returns TargetedAnimation[]

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

    Returns number

  • get isAdditive(): boolean
  • set isAdditive(value: boolean): void
  • 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 void

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

    Returns boolean

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

    Returns boolean

  • get loopAnimation(): boolean
  • set loopAnimation(value: boolean): void
  • 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 void

  • get speedRatio(): number
  • set speedRatio(value: number): void
  • 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 void

  • Gets the targeted animations for this animation group

    Returns TargetedAnimation[]

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

    Returns number

Methods

  • 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

  • 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

  • dispose(): void
  • Dispose all associated resources

    Returns void

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

    Returns string

    "AnimationGroup"

  • Goes to a specific frame in this animation group

    Parameters

    • frame: number

      the frame number to go to

    Returns AnimationGroup

    the animationGroup

  • 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

  • Pause all animations

    Returns AnimationGroup

    the animation group

  • 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

  • Reset all animations to initial state

    Returns AnimationGroup

    the animation group

  • Restart animations from key 0

    Returns AnimationGroup

    the animation group

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

    Returns any

    Serialized object

  • 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

  • Stop all animations

    Returns AnimationGroup

    the animation group

  • 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

  • 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

  • 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 constructor
  • Static method

Settings

Theme