[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
[property:Object3d root]
The root object of the animation.
[property:Object data]
The data containing the animation
[property:Array hierarchy]
The objects that are influenced by the animation.
[property:number currentTime]
The time elapsed since the last start/restart of the animation.
[property:number timeScale]
How much to scale the speed of the animation. Defaults to 1.
[property:boolean isPlaying]
Indicates whether the animation is playing. This shouldn't be adapted by user code.
[property:boolean isPaused]
Indicates whether the animation is paused. This shouldn't be adapted by user code.
[property:boolean loop]
Set to make the animation restart when the animation ends.
[property:number interpolationType]
The type to indicate how to interpolate between 2 data points.
Methods
[method:null play]([page:Number startTime])
Starts the animation at the startTime (in seconds) of the animation.
[method:null stop]()
Stops the animation.
[method:Boolean update]([page:Number deltaTimeMS])
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.
[method:array interpolateCatmullRom]([page:Array points], [page:Number scale])
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.
[method:Object getNextKeyWith]([page:String type], [page:Object h], [page:Number key])
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.
[method:Object getPrevKeyWith]([page:String type], [page:Object h], [page:Number key])
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]