FlyControls.html 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>FlyControls - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Controls.html">Controls</a> → </p>
  13. <h1 translate="no">FlyControls</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class enables a navigation similar to fly modes in DCC tools like Blender.
  17. You can arbitrarily transform the camera in 3D space without any limitations
  18. (e.g. focus on a specific target).</p></div>
  19. </header>
  20. <article>
  21. <h2 class="subsection-title">Import</h2>
  22. <p><span translate="no">FlyControls</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  23. <pre><code class="language-js">import { FlyControls } from 'three/addons/controls/FlyControls.js';</code></pre>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="FlyControls" translate="no">new <a href="#FlyControls">FlyControls</a><span class="signature">( object : <span class="param-type">Object3D</span>, domElement : <span class="param-type">HTMLElement</span> )</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new controls instance.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name"><code>object</code></td>
  35. <td class="description last"><p>The object that is managed by the controls.</p></td>
  36. </tr>
  37. <tr>
  38. <td class="name"><code>domElement</code></td>
  39. <td class="description last"><p>The HTML element used for event listeners.<br/>Default is <code>null</code>.</p></td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Properties</h2>
  46. <div class="member">
  47. <h3 class="name" id="autoForward" translate="no">.<a href="#autoForward">autoForward</a><span class="type-signature"> : boolean</span> </h3>
  48. <div class="description">
  49. <p>If set to <code>true</code>, the camera automatically moves forward (and does not stop) when initially translated.<br/>Default is <code>false</code>.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="dragToLook" translate="no">.<a href="#dragToLook">dragToLook</a><span class="type-signature"> : boolean</span> </h3>
  54. <div class="description">
  55. <p>If set to <code>true</code>, you can only look around by performing a drag interaction.<br/>Default is <code>false</code>.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <h3 class="name" id="movementSpeed" translate="no">.<a href="#movementSpeed">movementSpeed</a><span class="type-signature"> : number</span> </h3>
  60. <div class="description">
  61. <p>The movement speed.<br/>Default is <code>1</code>.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <h3 class="name" id="rollSpeed" translate="no">.<a href="#rollSpeed">rollSpeed</a><span class="type-signature"> : number</span> </h3>
  66. <div class="description">
  67. <p>The rotation speed.<br/>Default is <code>0.005</code>.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Events</h2>
  71. <h3 class="name name-method" id="event:change" translate="no">.<a href="#event:change">change</a> </h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>Fires when the camera has been transformed by the controls.</p>
  75. </div>
  76. <h5>Type:</h5>
  77. <ul>
  78. <li>
  79. <span class="param-type">Object</span>
  80. </li>
  81. </ul>
  82. </div>
  83. <h2 class="subsection-title">Source</h2>
  84. <p>
  85. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/FlyControls.js" target="_blank" rel="noopener" translate="no">examples/jsm/controls/FlyControls.js</a>
  86. </p>
  87. </article>
  88. </section>
  89. <script src="../scripts/linenumber.js"></script>
  90. <script src="../scripts/page.js"></script>
  91. </body>
  92. </html>
粤ICP备19079148号