API

Class AnimationGroup

Use this class to create coordinated animations on multiple targets

Implements

Index
metadata: any = null

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

  • Clone the current animation group and returns a copy

    Parameters

    • newName: string

      defines the name of the new group

    • OptionaltargetConverter: (oldTarget: any) => any

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

    • cloneAnimations: boolean = false

      defines if the animations should be cloned or referenced

    • cloneAnimationKeys: boolean = false

      defines if the animation keys should be cloned when cloning animations (false by default). No effect if cloneAnimations is false

    Returns AnimationGroup

    the new animation group

  • Gets the length (in seconds) of the animation group This function assumes that all animations are played at the same framePerSecond speed! Note: you can only call this method after you've added at least one targeted animation!

    Parameters

    • Optionalfrom: number

      Starting frame range (default is AnimationGroup.from)

    • Optionalto: number

      Ending frame range (default is AnimationGroup.to)

    Returns number

    The length in seconds

  • Goes to a specific frame in this animation group. Note that the animation group must be in playing or paused status

    Parameters

    • frame: number

      the frame number to go to

    • useWeight: boolean = false

      defines whether the animation weight should be applied to the image to be jumped to (false by default)

    Returns AnimationGroup

    the animationGroup

  • Returns whether a frame is inside the requested start/end interval. The end frame is excluded because natural completion takes precedence.

    Parameters

    • frame: number

      virtual frame to test

    Returns boolean

    true when a scheduled stop may occur at the frame

  • Returns whether the virtual timeline crossed the requested frame.

    Parameters

    • frame: number

      virtual frame to test

    Returns boolean

    true when the frame was reached in the playback direction

  • 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

    • beginFrame: Nullable<number> = null

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

    • endFrame: Nullable<number> = null

      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

  • Removes all animations for the targets not retained by the animation group mask. Use this function if you know you won't need those animations anymore and if you want to free memory.

    Returns void

  • Start all animations on given targets

    Parameters

    • loop: boolean = false

      defines if animations must loop

    • speedRatio: number = 1

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

    • Optionalfrom: number

      defines the from key (optional)

    • Optionalto: number

      defines the to key (optional)

    • OptionalisAdditive: boolean

      defines the additive state for the resulting animatables (optional)

    Returns AnimationGroup

    the current animation group

  • Starts all animations using an unbounded requested timeline mapped to the animation's effective keyframe range.

    Parameters

    • loop: boolean = false

      defines if animations must loop

    • speedRatio: number = 1

      defines the ratio to apply to animation speed

    • Optionalfrom: number

      defines the requested start frame

    • Optionalto: number

      defines the requested end frame

    • OptionalisAdditive: boolean

      defines the additive state for the resulting animatables

    Returns AnimationGroup

    the current animation group

  • Makes sure that the animations are either played or stopped according to the animation group mask. Note however that the call won't have any effect if the animation group has not been started yet.

    Parameters

    • forceUpdate: boolean = false

      If true, forces to loop over the animatables even if no mask is defined (used internally, you shouldn't need to use it). Default: false.

    Returns void

  • Creates a detailed string about the object

    Parameters

    • OptionalfullDetails: boolean

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

    Returns string

    a string representing the object