Class RuntimeAnimation
Constructors
constructor
-
new RuntimeAnimation(
target: any,
animation: Animation,
scene: Scene,
host: Animatable,
): RuntimeAnimationCreate a new RuntimeAnimation object
Parameters
- target: any
defines the target of the animation
- animation: Animation
defines the source animation object
- scene: Scene
defines the hosting scene
- host: Animatable
defines the initiating Animatable
Returns RuntimeAnimation
- target: any
Accessors
animation
-
Gets the animation from the runtime animation
Returns Animation
current Frame
-
get currentFrame(): number
Gets the current frame of the runtime animation
Returns number
current Value
-
get currentValue(): any
Gets the current value of the runtime animation
Returns any
is Additive
-
get isAdditive(): boolean
Gets the additive state of the runtime animation
Returns boolean
target
-
get target(): any
Gets the actual target of the runtime animation
Returns any
target Path
-
get targetPath(): string
Gets or sets the target path of the runtime animation
Returns string
weight
-
get weight(): number
Gets the weight of the runtime animation
Returns number
Methods
animate
-
animate(
elapsedTimeSinceAnimationStart: number,
from: number,
to: number,
loop: boolean,
speedRatio: number,
weight?: number,
): booleanExecute the current animation
Parameters
- elapsedTimeSinceAnimationStart: number
defines the elapsed time (in milliseconds) since the animation was started
- from: number
defines the lower frame of the animation range
- to: number
defines the upper frame of the animation range
- loop: boolean
defines if the current animation must loop
- speedRatio: number
defines the current speed ratio
- weight: number = -1.0
defines the weight of the animation (default is -1 so no weight)
Returns boolean
a boolean indicating if the animation is running
- elapsedTimeSinceAnimationStart: number
dispose
-
Disposes of the runtime animation
Returns void
go To Frame
-
Move the current animation to a given frame
Parameters
- frame: number
defines the frame to move to
- weight: number = -1
defines the weight to apply to the animation (-1.0 by default)
Returns void
- frame: number
is Stopped
-
Specifies if the runtime animation is stopped
Returns boolean
Boolean specifying if the runtime animation is stopped
reset
-
Resets the runtime animation to the beginning
Parameters
- restoreOriginal: boolean = false
defines whether to restore the target property to the original value
Returns void
- restoreOriginal: boolean = false
set Value
-
Apply the interpolated value to the target
Parameters
- currentValue: any
defines the value computed by the animation
- weight: number
defines the weight to apply to this value (Defaults to 1.0)
Returns void
- currentValue: any
Defines a runtime animation