| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>BVHLoader - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="Loader.html">Loader</a> → </p>
- <h1 translate="no">BVHLoader</h1>
- <section>
- <header>
- <div class="class-description"><p>A loader for the BVH format.</p>
- <p>Imports BVH files and outputs a single <a href="Skeleton.html">Skeleton</a> and <a href="AnimationClip.html">AnimationClip</a>.
- The loader only supports BVH files containing a single root right now.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const loader = new BVHLoader();
- const result = await loader.loadAsync( 'models/bvh/pirouette.bvh' );
- // visualize skeleton
- const skeletonHelper = new THREE.SkeletonHelper( result.skeleton.bones[ 0 ] );
- scene.add( result.skeleton.bones[ 0 ] );
- scene.add( skeletonHelper );
- // play animation clip
- mixer = new THREE.AnimationMixer( result.skeleton.bones[ 0 ] );
- mixer.clipAction( result.clip ).play();
- </code></pre></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">BVHLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
- <pre><code class="language-js">import { BVHLoader } from 'three/addons/loaders/BVHLoader.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="BVHLoader" translate="no">new <a href="#BVHLoader">BVHLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new BVH loader.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>manager</code></td>
- <td class="description last"><p>The loading manager.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="animateBonePositions" translate="no">.<a href="#animateBonePositions">animateBonePositions</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Whether to animate bone positions or not.<br/>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="animateBoneRotations" translate="no">.<a href="#animateBoneRotations">animateBoneRotations</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Whether to animate bone rotations or not.<br/>Default is <code>true</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="load" translate="no">.<a href="#load">load</a><span class="signature">( url : <span class="param-type">string</span>, onLoad : <span class="param-type">function</span>, onProgress : <span class="param-type">onProgressCallback</span>, onError : <span class="param-type">onErrorCallback</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Starts loading from the given URL and passes the loaded BVH asset
- to the <code>onLoad()</code> callback.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>url</code></td>
- <td class="description last"><p>The path/URL of the file to be loaded. This can also be a data URI.</p></td>
- </tr>
- <tr>
- <td class="name"><code>onLoad</code></td>
- <td class="description last"><p>Executed when the loading process has been finished.</p></td>
- </tr>
- <tr>
- <td class="name"><code>onProgress</code></td>
- <td class="description last"><p>Executed while the loading is in progress.</p></td>
- </tr>
- <tr>
- <td class="name"><code>onError</code></td>
- <td class="description last"><p>Executed when errors occur.</p></td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
- </dl>
- </div>
- <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( text : <span class="param-type">string</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Parses the given BVH data and returns the resulting data.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>text</code></td>
- <td class="description last"><p>The raw BVH data as a string.</p></td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
- </dl>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed asset.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/BVHLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/BVHLoader.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|