Class Animation
Hierarchy
- Animation
Index
Constructors
Properties
- blending
Speed - data
Type - enable
Blending - frame
Per Second - loop
Mode - name
- snippet
Id - target
Property - target
Property Path - unique
Id - ANIMATIONLOOPMODE_
CONSTANT - ANIMATIONLOOPMODE_
CYCLE - ANIMATIONLOOPMODE_
RELATIVE - ANIMATIONLOOPMODE_
RELATIVE_ FROM_ CURRENT - ANIMATIONLOOPMODE_
YOYO - ANIMATIONTYPE_
COLOR3 - ANIMATIONTYPE_
COLOR4 - ANIMATIONTYPE_
FLOAT - ANIMATIONTYPE_
MATRIX - ANIMATIONTYPE_
QUATERNION - ANIMATIONTYPE_
SIZE - ANIMATIONTYPE_
VECTOR2 - ANIMATIONTYPE_
VECTOR3 - Allow
Matrices Interpolation - Allow
Matrix Decompose For Interpolation - Create
From Snippet Async - Snippet
Url
Accessors
Methods
- add
Event - clone
- color3
Interpolate Function - color3
Interpolate Function With Tangents - color4
Interpolate Function - color4
Interpolate Function With Tangents - create
Key For Frame - create
Range - delete
Range - evaluate
- float
Interpolate Function - float
Interpolate Function With Tangents - get
Easing Function - get
Events - get
Highest Frame - get
Keys - get
Range - matrix
Interpolate Function - quaternion
Interpolate Function - quaternion
Interpolate Function With Tangents - remove
Events - serialize
- set
Easing Function - set
Keys - size
Interpolate Function - to
String - vector2
Interpolate Function - vector2
Interpolate Function With Tangents - vector3
Interpolate Function - vector3
Interpolate Function With Tangents - Append
Serialized Animations - Create
And Start Animation - Create
And Start Hierarchy Animation - Create
Animation - Create
Merge And Start Animation - Make
Animation Additive - Parse
- Parse
From File Async - Parse
From Snippet Async - Transition
To
Constructors
constructor
Initializes the animation
Parameters
name: string
Name of the animation
targetProperty: string
Property to animate
framePerSecond: number
The frames per second of the animation
dataType: number
The data type of the animation
Optional loopMode: number
The loop mode of the animation
Optional enableBlending: boolean
Specifies if blending should be enabled
Returns Animation
Properties
blending SpeedSearch playground for blendingSpeed
Stores the blending speed of the animation
data TypeSearch playground for dataType
The data type of the animation
Optional enable BlendingSearch playground for enableBlending
Specifies if blending should be enabled
frame Per SecondSearch playground for framePerSecond
The frames per second of the animation
Optional loop ModeSearch playground for loopMode
The loop mode of the animation
nameSearch playground for name
Name of the animation
snippet IdSearch playground for snippetId
Snippet ID if the animation was created from the snippet server
target PropertySearch playground for targetProperty
Property to animate
target Property PathSearch playground for targetPropertyPath
Stores an array of target property paths
unique IdSearch playground for uniqueId
Gets or sets the unique id of the animation (the uniqueness is solely among other animations)
Static Readonly ANIMATIONLOOPMODE_ CONSTANTSearch playground for ANIMATIONLOOPMODE_CONSTANT
Constant Loop Mode
Static Readonly ANIMATIONLOOPMODE_ CYCLESearch playground for ANIMATIONLOOPMODE_CYCLE
Cycle Loop Mode
Static Readonly ANIMATIONLOOPMODE_ RELATIVESearch playground for ANIMATIONLOOPMODE_RELATIVE
Relative Loop Mode
Static Readonly ANIMATIONLOOPMODE_ RELATIVE_ FROM_ CURRENTSearch playground for ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT
Relative Loop Mode (add to current value of animated object, unlike ANIMATIONLOOPMODE_RELATIVE)
Static Readonly ANIMATIONLOOPMODE_ YOYOSearch playground for ANIMATIONLOOPMODE_YOYO
Yoyo Loop Mode
Static Readonly ANIMATIONTYPE_ COLOR3Search playground for ANIMATIONTYPE_COLOR3
Color3 animation type
Static Readonly ANIMATIONTYPE_ COLOR4Search playground for ANIMATIONTYPE_COLOR4
Color3 animation type
Static Readonly ANIMATIONTYPE_ FLOATSearch playground for ANIMATIONTYPE_FLOAT
Float animation type
Static Readonly ANIMATIONTYPE_ MATRIXSearch playground for ANIMATIONTYPE_MATRIX
Matrix animation type
Static Readonly ANIMATIONTYPE_ QUATERNIONSearch playground for ANIMATIONTYPE_QUATERNION
Quaternion animation type
Static Readonly ANIMATIONTYPE_ SIZESearch playground for ANIMATIONTYPE_SIZE
Size animation type
Static Readonly ANIMATIONTYPE_ VECTOR2Search playground for ANIMATIONTYPE_VECTOR2
Vector2 animation type
Static Readonly ANIMATIONTYPE_ VECTOR3Search playground for ANIMATIONTYPE_VECTOR3
Vector3 animation type
Static Allow Matrices InterpolationSearch playground for AllowMatricesInterpolation
Use matrix interpolation instead of using direct key value when animating matrices
Static Allow Matrix Decompose For InterpolationSearch playground for AllowMatrixDecomposeForInterpolation
When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower
Static Create From Snippet AsyncSearch playground for CreateFromSnippetAsync
Static Snippet UrlSearch playground for SnippetUrl
Define the Url to load snippets
Accessors
has Running Runtime Animations
Specifies if any of the runtime animations are currently running
Returns boolean
runtime Animations
Return the array of runtime animations currently using this animation
Returns RuntimeAnimation[]
Methods
add EventSearch playground for addEvent
Add an event to this animation
Parameters
event: AnimationEvent
Event to add
Returns void
cloneSearch playground for clone
Makes a copy of the animation
Returns Animation
Cloned animation
color3 Interpolate FunctionSearch playground for color3InterpolateFunction
color3 Interpolate Function With TangentsSearch playground for color3InterpolateFunctionWithTangents
Interpolates a Color3 cubically
Parameters
startValue: Color3
Start value of the animation curve
outTangent: Color3
End tangent of the animation
endValue: Color3
End value of the animation curve
inTangent: Color3
Start tangent of the animation curve
gradient: number
Scalar amount to interpolate
Returns Color3
interpolated value
color4 Interpolate FunctionSearch playground for color4InterpolateFunction
color4 Interpolate Function With TangentsSearch playground for color4InterpolateFunctionWithTangents
Interpolates a Color4 cubically
Parameters
startValue: Color4
Start value of the animation curve
outTangent: Color4
End tangent of the animation
endValue: Color4
End value of the animation curve
inTangent: Color4
Start tangent of the animation curve
gradient: number
Scalar amount to interpolate
Returns Color4
interpolated value
create Key For FrameSearch playground for createKeyForFrame
Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame
Parameters
frame: number
Frame number
Returns number
The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key
create RangeSearch playground for createRange
Creates an animation range
Parameters
name: string
Name of the animation range
from: number
Starting frame of the animation range
to: number
Ending frame of the animation
Returns void
delete RangeSearch playground for deleteRange
Deletes an animation range by name
Parameters
name: string
Name of the animation range to delete
Optional deleteFrames: boolean
Specifies if the key frames for the range should also be deleted (true) or not (false)
Returns void
evaluateSearch playground for evaluate
Evaluate the animation value at a given frame
Parameters
currentFrame: number
defines the frame where we want to evaluate the animation
Returns any
the animation value
float Interpolate FunctionSearch playground for floatInterpolateFunction
Interpolates a scalar linearly
Parameters
startValue: number
Start value of the animation curve
endValue: number
End value of the animation curve
gradient: number
Scalar amount to interpolate
Returns number
Interpolated scalar value
float Interpolate Function With TangentsSearch playground for floatInterpolateFunctionWithTangents
Interpolates a scalar cubically
Parameters
startValue: number
Start value of the animation curve
outTangent: number
End tangent of the animation
endValue: number
End value of the animation curve
inTangent: number
Start tangent of the animation curve
gradient: number
Scalar amount to interpolate
Returns number
Interpolated scalar value
get Easing FunctionSearch playground for getEasingFunction
Gets the easing function of the animation
Returns Nullable<IEasingFunction>
Easing function of the animation
get EventsSearch playground for getEvents
Retrieves all the events from the animation
Returns AnimationEvent[]
Events from the animation
get Highest FrameSearch playground for getHighestFrame
Gets the highest frame rate of the animation
Returns number
Highest frame rate of the animation
get KeysSearch playground for getKeys
Gets the key frames from the animation
Returns IAnimationKey[]
The key frames of the animation
get RangeSearch playground for getRange
Gets the animation range by name, or null if not defined
Parameters
name: string
Name of the animation range
Returns Nullable<AnimationRange>
Nullable animation range
matrix Interpolate FunctionSearch playground for matrixInterpolateFunction
Defines the function to use to interpolate matrices
Parameters
startValue: Matrix
defines the start matrix
endValue: Matrix
defines the end matrix
gradient: number
defines the gradient between both matrices
Optional result: Matrix
defines an optional target matrix where to store the interpolation
Returns Matrix
the interpolated matrix
quaternion Interpolate FunctionSearch playground for quaternionInterpolateFunction
Interpolates a quaternion using a spherical linear interpolation
Parameters
startValue: Quaternion
Start value of the animation curve
endValue: Quaternion
End value of the animation curve
gradient: number
Scalar amount to interpolate
Returns Quaternion
Interpolated quaternion value
quaternion Interpolate Function With TangentsSearch playground for quaternionInterpolateFunctionWithTangents
Interpolates a quaternion cubically
Parameters
startValue: Quaternion
Start value of the animation curve
outTangent: Quaternion
End tangent of the animation curve
endValue: Quaternion
End value of the animation curve
inTangent: Quaternion
Start tangent of the animation curve
gradient: number
Scalar amount to interpolate
Returns Quaternion
Interpolated quaternion value
remove EventsSearch playground for removeEvents
Remove all events found at the given frame
Parameters
frame: number
The frame to remove events from
Returns void
serializeSearch playground for serialize
Serializes the animation to an object
Returns any
Serialized object
set Easing FunctionSearch playground for setEasingFunction
Sets the easing function of the animation
Parameters
easingFunction: Nullable<IEasingFunction>
A custom mathematical formula for animation
Returns void
set KeysSearch playground for setKeys
Sets the key frames of the animation
Parameters
values: IAnimationKey[]
The animation key frames to set
Optional dontClone: boolean
Whether to clone the keys or not (default is false, so the array of keys is cloned)
Returns void
size Interpolate FunctionSearch playground for sizeInterpolateFunction
to StringSearch playground for toString
Converts the animation to a string
Parameters
Optional fullDetails: boolean
support for multiple levels of logging within scene loading
Returns string
String form of the animation
vector2 Interpolate FunctionSearch playground for vector2InterpolateFunction
vector2 Interpolate Function With TangentsSearch playground for vector2InterpolateFunctionWithTangents
Interpolates a Vector2 cubically
Parameters
startValue: Vector2
Start value of the animation curve
outTangent: Vector2
End tangent of the animation
endValue: Vector2
End value of the animation curve
inTangent: Vector2
Start tangent of the animation curve
gradient: number
Scalar amount to interpolate (value between 0 and 1)
Returns Vector2
Interpolated Vector2 value
vector3 Interpolate FunctionSearch playground for vector3InterpolateFunction
vector3 Interpolate Function With TangentsSearch playground for vector3InterpolateFunctionWithTangents
Interpolates a Vector3 cubically
Parameters
startValue: Vector3
Start value of the animation curve
outTangent: Vector3
End tangent of the animation
endValue: Vector3
End value of the animation curve
inTangent: Vector3
Start tangent of the animation curve
gradient: number
Scalar amount to interpolate (value between 0 and 1)
Returns Vector3
InterpolatedVector3 value
Static Append Serialized AnimationsSearch playground for AppendSerializedAnimations
Appends the serialized animations from the source animations
Parameters
source: IAnimatable
Source containing the animations
destination: any
Target to store the animations
Returns void
Static Create And Start AnimationSearch playground for CreateAndStartAnimation
Create and start an animation on a node
Parameters
name: string
defines the name of the global animation that will be run on all nodes
target: any
defines the target where the animation will take place
targetProperty: string
defines property to animate
framePerSecond: number
defines the number of frame per second yo use
totalFrame: number
defines the number of frames in total
from: any
defines the initial value
to: any
defines the final value
Optional loopMode: number
defines which loop mode you want to use (off by default)
Optional easingFunction: EasingFunction
defines the easing function to use (linear by default)
Optional onAnimationEnd: (() => void)
defines the callback to call when animation end
Returns void
Optional scene: Scene
defines the hosting scene
Returns Nullable<Animatable>
the animatable created for this animation
Static Create And Start Hierarchy AnimationSearch playground for CreateAndStartHierarchyAnimation
Create and start an animation on a node and its descendants
Parameters
name: string
defines the name of the global animation that will be run on all nodes
node: Node
defines the root node where the animation will take place
directDescendantsOnly: boolean
if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used
targetProperty: string
defines property to animate
framePerSecond: number
defines the number of frame per second to use
totalFrame: number
defines the number of frames in total
from: any
defines the initial value
to: any
defines the final value
Optional loopMode: number
defines which loop mode you want to use (off by default)
Optional easingFunction: EasingFunction
defines the easing function to use (linear by default)
Optional onAnimationEnd: (() => void)
defines the callback to call when an animation ends (will be called once per node)
Returns void
Returns Nullable<Animatable[]>
the list of animatables created for all nodes
Static Create AnimationSearch playground for CreateAnimation
Sets up an animation
Parameters
property: string
The property to animate
animationType: number
The animation type to apply
framePerSecond: number
The frames per second of the animation
easingFunction: EasingFunction
The easing function used in the animation
Returns Animation
The created animation
Static Create Merge And Start AnimationSearch playground for CreateMergeAndStartAnimation
Creates a new animation, merges it with the existing animations and starts it
Parameters
name: string
Name of the animation
node: Node
Node which contains the scene that begins the animations
targetProperty: string
Specifies which property to animate
framePerSecond: number
The frames per second of the animation
totalFrame: number
The total number of frames
from: any
The frame at the beginning of the animation
to: any
The frame at the end of the animation
Optional loopMode: number
Specifies the loop mode of the animation
Optional easingFunction: EasingFunction
(Optional) The easing function of the animation, which allow custom mathematical formulas for animations
Optional onAnimationEnd: (() => void)
Callback to run once the animation is complete
Returns void
Returns Nullable<Animatable>
Nullable animation
Static Make Animation AdditiveSearch playground for MakeAnimationAdditive
Convert the keyframes of an animation to be relative to a given reference frame.
Parameters
sourceAnimation: Animation
defines the Animation containing keyframes to convert
Optional referenceFrame: number
defines the frame that keyframes in the range will be relative to (default: 0)
Optional range: string
defines the name of the AnimationRange belonging to the Animation to convert
Optional cloneOriginal: boolean
defines whether or not to clone the animation and convert the clone or convert the original animation (default is false)
Optional clonedName: string
defines the name of the resulting cloned Animation if cloneOriginal is true
Returns Animation
a new Animation if cloneOriginal is true or the original Animation if cloneOriginal is false
Convert the keyframes of an animation to be relative to a given reference frame.
Parameters
sourceAnimation: Animation
defines the Animation containing keyframes to convert
Optional options: IMakeAnimationAdditiveOptions
defines the options to use when converting ey keyframes
Returns Animation
a new Animation if options.cloneOriginalAnimation is true or the original Animation if options.cloneOriginalAnimation is false
Static ParseSearch playground for Parse
Parses an animation object and creates an animation
Parameters
parsedAnimation: any
Parsed animation object
Returns Animation
Animation object
Static Parse From File AsyncSearch playground for ParseFromFileAsync
Creates a new animation or an array of animations from a snippet saved in a remote file
Parameters
name: Nullable<string>
defines the name of the animation to create (can be null or empty to use the one from the json data)
url: string
defines the url to load from
Returns Promise<Animation | Animation[]>
a promise that will resolve to the new animation or an array of animations
Static Parse From Snippet AsyncSearch playground for ParseFromSnippetAsync
Static Transition ToSearch playground for TransitionTo
Transition property of an host to the target Value
Parameters
property: string
The property to transition
targetValue: any
The target Value of the property
host: any
The object where the property to animate belongs
scene: Scene
Scene used to run the animation
frameRate: number
Framerate (in frame/s) to use
transition: Animation
The transition type we want to use
duration: number
The duration of the animation, in milliseconds
Optional onAnimationEnd: Nullable<(() => void)>
Callback trigger at the end of the animation
Returns Nullable<Animatable>
Nullable animation
Class used to store any kind of animation