A mesh that can blend together multiple animated morph targets.
[example:webgl_morphtargets_md2_control morphtargets / md2 / controll]
Constructor
[name]([page:Geometry geometry], [page:Material material])
geometry — An instance of [page:Geometry].
material — An instance of [page:Material] (optional).
Properties
[property:object animationsMap]
An object of named animations as added by [page:MorphBlendMesh.createAnimation].
[property:array animationsList]
The list of animations as added by [page:MorphBlendMesh.createAnimation].
Methods
[method:null setAnimationWeight]([page:String name], [page:Float weight])
name -- The name of the animation
weight -- Weight of the animation, typically 0-1
Set the weight of how much this animation will apply to the overall morph. 0 is off, 1 is full weight.
[method:null setAnimationFPS]([page:String name], [page:Float fps])
name -- The name of the animation
fps -- The number of frames (morphTargets) per second
A frame is typically 1 morph target.
[method:null createAnimation]([page:String name], [page:Integer start], [page:Integer end], [page:Float fps])
name -- The name of the animation
start -- The starting frame (morph)
end -- The ending frame (morph)
fps -- How many frames (morphs) to play per second
Creates an animation object that gets added to both the [page:MorphBlendMesh.animationsMap animationsMap] and
[page:MorphBlendMesh.animationsList animationsList].
Animation object:
startFrame -- Starting frame
endFrame -- Ending frame
length -- The number of frames
fps -- The frames per second
duration -- The length of the animation in seconds
lastFrame -- The previous frame that was played
currentFrame -- The current frame
active -- Whether or not the animation is being played
time -- The time in seconds of the animation
direction -- Which way to play the animation
weight -- The weight of the animation
directionBackwards -- Is playing backwards
mirroredLoop -- Loop back and forth
[method:null playAnimation]([page:String name])
name -- The name of the animation
Sets the animation to active and animation time to 0
[method:null update]([page:Float delta])
delta -- Time in seconds
Updates and plays the animation
[method:null autoCreateAnimations]([page:Float fps])
fps -- Frames per second
Goes through the geometry's morphTargets and generates animations based on the morphTargets' names. Names
are of the form "walk_01", "walk_02", "walk_03", etc or "run001", "run002", "run003".
[method:null setAnimationDuration]([page:String name], [page:Float duration])
name -- The name of the animation
duration -- How long in seconds to play the animation
Updates the animation object with proper values to update the duration.
[method:null setAnimationDirectionForward]([page:String name])
name -- The name of the animation
Sets the animation to play forwards
[method:null setAnimationDirectionBackward]([page:String name])
name -- The name of the animation
Sets the animation to play backwards
[method:Float getAnimationDuration]([page:String name])
name -- The name of the animation
Returns the duration in seconds of the animation. Returns -1 if it can't be found.
[method:Float getAnimationTime]([page:String name])
name -- The name of the animation
Returns the current time position of the animation.
[method:null setAnimationTime]([page:String name], [page:Float time])
name -- The name of the animation
time -- The time in seconds
Sets the current time position of the animation
[method:null stopAnimation]([page:String name])
name -- The name of the animation
Stops the playback of the animation
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]