[name]
This class animates an object based on an hierarchy.This hierarchy can be Object3Ds or bones.
Constructor
[name]([page:Object3d root], [page:String name])
root -- The mesh to animate.
name -- The name of the animation
Creates an animation for root. The animation data is gathered from AnimationHandler based on its name.
Properties
.[page:Object3d root]
The root object of the animation.
.[page:Object data]
The data containing the animation
.[page:Array hierarchy]
The objects that are influenced by the animation.
.[page:number currentTime]
The time elapsed since the last start/restart of the animation.
.[page:number timeScale]
The timez
.[page:boolean isPlaying]
Indicates whether the animation is playing. This shouldn't be adapted by user code.
.[page:boolean isPaused]
Indicates whether the animation is paused. This shouldn't be adapted by user code.
.[page:boolean loop]
Set to make the animation restart when the animation ends.
.[page:number interpolationType]
The type to indicate how to interpolate between 2 data points.
.[page:array points]
This should be removed from the code.(TODO).
.[page:Vector3 target]
This should be removed from the code.(TODO).
Methods
.play([page:Number startTime])
Starts the animation from a moment startTime in the animation.
.pause()
Pauses the animation or restarts the animation after pausing it.
.stop()
Stops the animation.
.update([page:Number deltaTimeMS]) [page:todo]
deltaTimeMS -- The time of the between the previous frame and this frame in miliseconds.
Updates the animation in time. This shouldn't be called by user code. The animationHandler calls this method.
.interpolateCatmullRom([page:Array points], [page:Number scale]) [page:array]
points -- The 4 control point to calculate CatMullRom
scale -- The scale between the previous key and the nex key
Interpolates the point based on the key. Is used in update.
.getNextKeyWith([page:String type], [page:Object h], [page:Number key]) [page:Object]
type -- The animationtype for the key. Can be "pos", "rot" and "scl".
h -- The object of the hierarchy that catins the key
key -- The index of the next possible key.
Gets the next key. Is used in Update.
.getPrevKeyWith([page:String type], [page:Object h], [page:Number key]) [page:Object]
type -- The animationtype for the key. Can be "pos", "rot" and "scl".
h -- The object of the hierarchy that contains the key.
key -- The index of the prev possible key.
Gets the previous key. Is used in Update.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]