123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- [page:Mesh] →
- <h1>[name]</h1>
- <div class="desc">A mesh that can blend together multiple animated morph targets.</div>
- <h2>Example</h2>
- <div>
- [example:webgl_morphtargets_md2_control morphtargets / md2 / controll]
- <h2>Constructor</h2>
- <h3>[name]([page:Geometry geometry], [page:Material material])</h3>
- <div>
- geometry — An instance of [page:Geometry].<br />
- material — An instance of [page:Material] (optional).
- </div>
- <h2>Properties</h2>
- <h3>[property:object animationsMap]</h3>
- <div>
- An object of named animations as added by [page:MorphBlendMesh.createAnimation].
- </div>
- <h3>[property:array animationsList]</h3>
- <div>
- The list of animations as added by [page:MorphBlendMesh.createAnimation].
- </div>
- <h2>Methods</h2>
- <h3>[method:null setAnimationWeight]([page:String name], [page:Float weight])</h3>
- <div>
- name -- The name of the animation<br />
- weight -- Weight of the animation, typically 0-1
- </div>
- <div>
- Set the weight of how much this animation will apply to the overall morph. 0 is off, 1 is full weight.
- </div>
- <h3>[method:null setAnimationFPS]([page:String name], [page:Float fps])</h3>
- <div>
- name -- The name of the animation <br />
- fps -- The number of frames (morphTargets) per second
- </div>
- <div>
- A frame is typically 1 morph target.
- </div>
- <h3>[method:null createAnimation]([page:String name], [page:Integer start], [page:Integer end], [page:Float fps])</h3>
- <div>
- name -- The name of the animation <br />
- start -- The starting frame (morph)<br />
- end -- The ending frame (morph)<br />
- fps -- How many frames (morphs) to play per second
- </div>
- <div>
- Creates an animation object that gets added to both the [page:MorphBlendMesh.animationsMap animationsMap] and
- [page:MorphBlendMesh.animationsList animationsList].<br/><br/>
- Animation object:<br/><br/>
- startFrame -- Starting frame<br/>
- endFrame -- Ending frame<br/>
- length -- The number of frames<br/>
- fps -- The frames per second<br/>
- duration -- The length of the animation in seconds<br/>
- lastFrame -- The previous frame that was played<br/>
- currentFrame -- The current frame<br/>
- active -- Whether or not the animation is being played<br/>
- time -- The time in seconds of the animation<br/>
- direction -- Which way to play the animation<br/>
- weight -- The weight of the animation<br/>
- directionBackwards -- Is playing backwards<br/>
- mirroredLoop -- Loop back and forth
- </div>
- <h3>[method:null playAnimation]([page:String name])</h3>
- <div>
- name -- The name of the animation
- </div>
- <div>
- Sets the animation to active and animation time to 0
- </div>
- <h3>[method:null update]([page:Float delta])</h3>
- <div>
- delta -- Time in seconds
- </div>
- <div>
- Updates and plays the animation
- </div>
- <h3>[method:null autoCreateAnimations]([page:Float fps])</h3>
- <div>
- fps -- Frames per second
- </div>
- <div>
- 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".
- </div>
- <h3>[method:null setAnimationDuration]([page:String name], [page:Float duration])</h3>
- <div>
- name -- The name of the animation <br />
- duration -- How long in seconds to play the animation
- </div>
- <div>
- Updates the animation object with proper values to update the duration.
- </div>
- <h3>[method:null setAnimationDirectionForward]([page:String name])</h3>
- <div>
- name -- The name of the animation
- </div>
- <div>
- Sets the animation to play forwards
- </div>
- <h3>[method:null setAnimationDirectionBackward]([page:String name])</h3>
- <div>
- name -- The name of the animation
- </div>
- <div>
- Sets the animation to play backwards
- </div>
- <h3>[method:Float getAnimationDuration]([page:String name])</h3>
- <div>
- name -- The name of the animation
- </div>
- <div>
- Returns the duration in seconds of the animation. Returns -1 if it can't be found.
- </div>
- <h3>[method:Float getAnimationTime]([page:String name])</h3>
- <div>
- name -- The name of the animation
- </div>
- <div>
- Returns the current time position of the animation.
- </div>
- <h3>[method:null setAnimationTime]([page:String name], [page:Float time])</h3>
- <div>
- name -- The name of the animation <br />
- time -- The time in seconds
- </div>
- <div>
- Sets the current time position of the animation
- </div>
- <h3>[method:null stopAnimation]([page:String name])</h3>
- <div>
- name -- The name of the animation
- </div>
- <div>
- Stops the playback of the animation
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|