Controls.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Controls - 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> → </p>
  13. <h1 translate="no">Controls</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Abstract base class for controls.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="Controls" translate="no">new <a href="#Controls">Controls</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, domElement : <span class="param-type">HTMLElement</span> )</span> <span class="type-signature">(abstract) </span></h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new controls instance.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name">
  30. <strong>object</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The object that is managed by the controls.</p>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td class="name">
  38. <strong>domElement</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The HTML element used for event listeners.</p>
  42. <p>Default is <code>null</code>.</p>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Properties</h2>
  50. <div class="member">
  51. <h3 class="name" id="domElement" translate="no">.<a href="#domElement">domElement</a><span class="type-signature"> : HTMLElement</span> </h3>
  52. <div class="description">
  53. <p>The HTML element used for event listeners.</p>
  54. <p>Default is <code>null</code>.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="enabled" translate="no">.<a href="#enabled">enabled</a><span class="type-signature"> : boolean</span> </h3>
  59. <div class="description">
  60. <p>Whether the controls responds to user input or not.</p>
  61. <p>Default is <code>true</code>.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <h3 class="name" id="keys" translate="no">.<a href="#keys">keys</a><span class="type-signature"> : Object</span> </h3>
  66. <div class="description">
  67. <p>This object defines the keyboard input of the controls.</p>
  68. </div>
  69. </div>
  70. <div class="member">
  71. <h3 class="name" id="mouseButtons" translate="no">.<a href="#mouseButtons">mouseButtons</a><span class="type-signature"> : Object</span> </h3>
  72. <div class="description">
  73. <p>This object defines what type of actions are assigned to the available mouse buttons.
  74. It depends on the control implementation what kind of mouse buttons and actions are supported.</p>
  75. </div>
  76. </div>
  77. <div class="member">
  78. <h3 class="name" id="object" translate="no">.<a href="#object">object</a><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
  79. <div class="description">
  80. <p>The object that is managed by the controls.</p>
  81. </div>
  82. </div>
  83. <div class="member">
  84. <h3 class="name" id="state" translate="no">.<a href="#state">state</a><span class="type-signature"> : number</span> </h3>
  85. <div class="description">
  86. <p>The internal state of the controls.</p>
  87. <p>Default is <code>-1</code>.</p>
  88. </div>
  89. </div>
  90. <div class="member">
  91. <h3 class="name" id="touches" translate="no">.<a href="#touches">touches</a><span class="type-signature"> : Object</span> </h3>
  92. <div class="description">
  93. <p>This object defines what type of actions are assigned to what kind of touch interaction.
  94. It depends on the control implementation what kind of touch interaction and actions are supported.</p>
  95. </div>
  96. </div>
  97. <h2 class="subsection-title">Methods</h2>
  98. <h3 class="name name-method" id="connect" translate="no">.<a href="#connect">connect</a><span class="signature">( element : <span class="param-type">HTMLElement</span> )</span> </h3>
  99. <div class="method">
  100. <div class="description">
  101. <p>Connects the controls to the DOM. This method has so called &quot;side effects&quot; since
  102. it adds the module's event listeners to the DOM.</p>
  103. </div>
  104. <table class="params">
  105. <tbody>
  106. <tr>
  107. <td class="name">
  108. <strong>element</strong>
  109. </td>
  110. <td class="description last">
  111. <p>The DOM element to connect to.</p>
  112. </td>
  113. </tr>
  114. </tbody>
  115. </table>
  116. </div>
  117. <h3 class="name name-method" id="disconnect" translate="no">.<a href="#disconnect">disconnect</a><span class="signature">()</span> </h3>
  118. <div class="method">
  119. <div class="description">
  120. <p>Disconnects the controls from the DOM.</p>
  121. </div>
  122. </div>
  123. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  124. <div class="method">
  125. <div class="description">
  126. <p>Call this method if you no longer want use to the controls. It frees all internal
  127. resources and removes all event listeners.</p>
  128. </div>
  129. </div>
  130. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( delta : <span class="param-type">number</span> )</span> </h3>
  131. <div class="method">
  132. <div class="description">
  133. <p>Controls should implement this method if they have to update their internal state
  134. per simulation step.</p>
  135. </div>
  136. <table class="params">
  137. <tbody>
  138. <tr>
  139. <td class="name">
  140. <strong>delta</strong>
  141. </td>
  142. <td class="description last">
  143. <p>The time delta in seconds.</p>
  144. </td>
  145. </tr>
  146. </tbody>
  147. </table>
  148. </div>
  149. <h2 class="subsection-title">Source</h2>
  150. <p>
  151. <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/Controls.js" translate="no" target="_blank" rel="noopener">src/extras/Controls.js</a>
  152. </p>
  153. </article>
  154. </section>
  155. <script src="../scripts/linenumber.js"></script>
  156. <script src="../scripts/page.js"></script>
  157. </body>
  158. </html>
粤ICP备19079148号