|
@@ -11,130 +11,158 @@
|
|
|
|
|
|
<h1>[name]</h1>
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">todo</div>
|
|
|
|
|
|
+ <div class="desc">Play a sequence of morphs in a smooth animation sequence.</div>
|
|
|
|
+
|
|
|
|
+ <h2>Examples</h2>
|
|
|
|
+
|
|
|
|
+ <div>
|
|
|
|
+ [example:webgl_lights_hemisphere lights / hemisphere ]<br/>
|
|
|
|
+ [example:webgl_morphtargets_md2 morphtargets / md2 ]<br/>
|
|
|
|
+ [example:webgl_loader_json_blender loader / json / blender ]
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <code>
|
|
|
|
+ var meshAnim;
|
|
|
|
+
|
|
|
|
+ loader.load( "models/animated/flamingo.js", function( geometry ) {
|
|
|
|
+
|
|
|
|
+ meshAnim = new THREE.MorphAnimMesh( geometry, material );
|
|
|
|
+ meshAnim.duration = 1000;
|
|
|
|
+ scene.add( meshAnim );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function update() {
|
|
|
|
+
|
|
|
|
+ var delta = clock.getDelta();
|
|
|
|
+ meshAnim.updateAnimation( 1000 * delta );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ </code>
|
|
|
|
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
|
|
|
|
- <h3>[name]([page:todo geometry], [page:todo material])</h3>
|
|
|
|
|
|
+ <h3>[name]([page:Geometry geometry], [page:Material material])</h3>
|
|
<div>
|
|
<div>
|
|
- geometry -- todo <br />
|
|
|
|
- material -- todo
|
|
|
|
|
|
+ geometry — An instance of [page:Geometry].<br />
|
|
|
|
+ material — An instance of [page:Material] (optional).
|
|
</div>
|
|
</div>
|
|
- <div>
|
|
|
|
- todo
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Properties</h2>
|
|
<h2>Properties</h2>
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
- <h3>[property:boolean directionBackwards]</h3>
|
|
|
|
|
|
+ <h3>[property:Boolean directionBackwards]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Animation is playing backwards
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:number direction]</h3>
|
|
|
|
|
|
+ <h3>[property:Float direction]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ 1 if playing forward, -1 if playing backwards
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:number endKeyframe]</h3>
|
|
|
|
|
|
+ <h3>[property:Integer startKeyframe]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ The first keyframe (morph) of the sequence
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:boolean mirroredLoop]</h3>
|
|
|
|
|
|
+ <h3>[property:Integer endKeyframe]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ The last keyframe (morph) of the sequence
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- <h3>[property:number startKeyframe]</h3>
|
|
|
|
|
|
+
|
|
|
|
+ <h3>[property:Boolean mirroredLoop]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Loop animation back and forth
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:number lastKeyframe]</h3>
|
|
|
|
|
|
+ <h3>[property:Integer lastKeyframe]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ The index of the last keyframe played.
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- <h3>[property:number length]</h3>
|
|
|
|
|
|
+
|
|
|
|
+ <h3>[property:Integer currentKeyframe]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ The index of the current frame being played.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:number time]</h3>
|
|
|
|
|
|
+ <h3>[property:Integer length]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ The number of frames (morphs)
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:number duration]</h3>
|
|
|
|
|
|
+ <h3>[property:Float time]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ The current playback position of the animation in milliseconds.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:number currentKeyframe]</h3>
|
|
|
|
|
|
+ <h3>[property:Float duration]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ The length of the animation in milliseconds.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h2>Methods</h2>
|
|
<h2>Methods</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- <h3>[method:todo setDirectionForward]()</h3>
|
|
|
|
|
|
+ <h3>[method:null setDirectionForward]()</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Sets the animation to play forwards
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:todo playAnimation]([page:todo label], [page:todo fps])</h3>
|
|
|
|
- <div>
|
|
|
|
- label -- todo <br />
|
|
|
|
- fps -- todo
|
|
|
|
- </div>
|
|
|
|
|
|
+ <h3>[method:null setDirectionBackward]()</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Set the animation to play backwards.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:todo setFrameRange]([page:todo start], [page:todo end])</h3>
|
|
|
|
|
|
+ <h3>[method:null playAnimation]([page:String label], [page:Float fps])</h3>
|
|
<div>
|
|
<div>
|
|
- start -- todo <br />
|
|
|
|
- end -- todo
|
|
|
|
|
|
+ label -- The label of the animation <br />
|
|
|
|
+ fps -- The frames per second (in seconds)
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Starts playing a labeled animation. Animations are defined by calling [page:MorphAnimMesh.parseAnimations parseAnimations].
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:todo setDirectionBackward]()</h3>
|
|
|
|
|
|
+ <h3>[method:null setFrameRange]([page:Integer start], [page:Integer end])</h3>
|
|
|
|
+ <div>
|
|
|
|
+ start -- The starting frame (morph) index <br />
|
|
|
|
+ end -- The ending frame (morph) index
|
|
|
|
+ </div>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Sets the range of morphs to be played
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:todo parseAnimations]()</h3>
|
|
|
|
|
|
+ <h3>[method:null parseAnimations]()</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Goes through the geometry's morphTargets and generates animations based on the morphTargets' names (morph.name). Names
|
|
|
|
+ are of the form "walk_01", "walk_02", "walk_03", etc or "run001", "run002", "run003". The animation label is then
|
|
|
|
+ the part before the underscore and number, so "walk" or "run" in the examples.<br/><br/>
|
|
|
|
+
|
|
|
|
+ This function changes the underlying geometry object by adding the animations property to it. This property
|
|
|
|
+ is set to an object of key/pair values, with the key being the label and the value being an object with
|
|
|
|
+ a start and end property that represents the frame index.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:todo updateAnimation]([page:todo delta])</h3>
|
|
|
|
|
|
+ <h3>[method:null updateAnimation]([page:Float delta])</h3>
|
|
<div>
|
|
<div>
|
|
- delta -- todo
|
|
|
|
|
|
+ delta -- The change in time in milliseconds
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Update the morphTargetInfluences array on the MorphAnimMesh.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:todo setAnimationLabel]([page:todo label], [page:todo start], [page:todo end])</h3>
|
|
|
|
|
|
+ <h3>[method:null setAnimationLabel]([page:String label], [page:Integer start], [page:Integer end])</h3>
|
|
<div>
|
|
<div>
|
|
- label -- todo <br />
|
|
|
|
- start -- todo <br />
|
|
|
|
- end -- todo
|
|
|
|
|
|
+ label -- The name of the animation <br />
|
|
|
|
+ start -- The starting frame index <br />
|
|
|
|
+ end -- The ending frame index
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Defines an animation. Sets the geometry.animations[label] to be an object with the start and end properties.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h2>Source</h2>
|
|
<h2>Source</h2>
|