FlyControls.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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" rel="noopener">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"><a href="Object3D.html">Object3D</a></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">
  35. <strong>object</strong>
  36. </td>
  37. <td class="description last">
  38. <p>The object that is managed by the controls.</p>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td class="name">
  43. <strong>domElement</strong>
  44. </td>
  45. <td class="description last">
  46. <p>The HTML element used for event listeners.</p>
  47. <p>Default is <code>null</code>.</p>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="autoForward" translate="no">.<a href="#autoForward">autoForward</a><span class="type-signature"> : boolean</span> </h3>
  57. <div class="description">
  58. <p>If set to <code>true</code>, the camera automatically moves forward (and does not stop) when initially translated.</p>
  59. <p>Default is <code>false</code>.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="dragToLook" translate="no">.<a href="#dragToLook">dragToLook</a><span class="type-signature"> : boolean</span> </h3>
  64. <div class="description">
  65. <p>If set to <code>true</code>, you can only look around by performing a drag interaction.</p>
  66. <p>Default is <code>false</code>.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="movementSpeed" translate="no">.<a href="#movementSpeed">movementSpeed</a><span class="type-signature"> : number</span> </h3>
  71. <div class="description">
  72. <p>The movement speed.</p>
  73. <p>Default is <code>1</code>.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="rollSpeed" translate="no">.<a href="#rollSpeed">rollSpeed</a><span class="type-signature"> : number</span> </h3>
  78. <div class="description">
  79. <p>The rotation speed.</p>
  80. <p>Default is <code>0.005</code>.</p>
  81. </div>
  82. </div>
  83. <h2 class="subsection-title">Events</h2>
  84. <h3 class="name name-method" id="event:change" translate="no">.<a href="#event:change">change</a> </h3>
  85. <div class="method">
  86. <div class="description">
  87. <p>Fires when the camera has been transformed by the controls.</p>
  88. </div>
  89. <h5>Type:</h5>
  90. <ul>
  91. <li>
  92. <span class="param-type">Object</span>
  93. </li>
  94. </ul>
  95. </div>
  96. <h2 class="subsection-title">Source</h2>
  97. <p>
  98. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/FlyControls.js" translate="no" target="_blank" rel="noopener">examples/jsm/controls/FlyControls.js</a>
  99. </p>
  100. </article>
  101. </section>
  102. <script src="../scripts/linenumber.js"></script>
  103. <script src="../scripts/page.js"></script>
  104. </body>
  105. </html>
粤ICP备19079148号