1
0

OculusHandModel.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>OculusHandModel - 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="Object3D.html">Object3D</a> → </p>
  13. <h1 translate="no">OculusHandModel</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Represents an Oculus hand model.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">OculusHandModel</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>
  21. <pre><code class="language-js">import { OculusHandModel } from 'three/addons/webxr/OculusHandModel.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="OculusHandModel" translate="no">new <a href="#OculusHandModel">OculusHandModel</a><span class="signature">( controller : <span class="param-type"><a href="Group.html">Group</a></span>, loader : <span class="param-type"><a href="Loader.html">Loader</a></span>, onLoad : <span class="param-type">function</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new Oculus hand model.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>controller</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The hand controller.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong>loader</strong>
  42. </td>
  43. <td class="description last">
  44. <p>A loader that is used to load hand models.</p>
  45. <p>Default is <code>null</code>.</p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="name">
  50. <strong>onLoad</strong>
  51. </td>
  52. <td class="description last">
  53. <p>A callback that is executed when a hand model has been loaded.</p>
  54. <p>Default is <code>null</code>.</p>
  55. </td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. <h2 class="subsection-title">Properties</h2>
  62. <div class="member">
  63. <h3 class="name" id="controller" translate="no">.<a href="#controller">controller</a><span class="type-signature"> : <a href="Group.html">Group</a></span> </h3>
  64. <div class="description">
  65. <p>The hand controller.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="envMap" translate="no">.<a href="#envMap">envMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  70. <div class="description">
  71. <p>The model's environment map.</p>
  72. <p>Default is <code>null</code>.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="loader" translate="no">.<a href="#loader">loader</a><span class="type-signature"> : <a href="Loader.html">Loader</a></span> </h3>
  77. <div class="description">
  78. <p>A loader that is used to load hand models.</p>
  79. <p>Default is <code>null</code>.</p>
  80. </div>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="mesh" translate="no">.<a href="#mesh">mesh</a><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> </h3>
  84. <div class="description">
  85. <p>The model mesh.</p>
  86. <p>Default is <code>null</code>.</p>
  87. </div>
  88. </div>
  89. <div class="member">
  90. <h3 class="name" id="motionController" translate="no">.<a href="#motionController">motionController</a><span class="type-signature"> : MotionController</span> </h3>
  91. <div class="description">
  92. <p>The motion controller.</p>
  93. <p>Default is <code>null</code>.</p>
  94. </div>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="onLoad" translate="no">.<a href="#onLoad">onLoad</a><span class="type-signature"> : function</span> </h3>
  98. <div class="description">
  99. <p>A callback that is executed when a hand model has been loaded.</p>
  100. <p>Default is <code>null</code>.</p>
  101. </div>
  102. </div>
  103. <div class="member">
  104. <h3 class="name" id="path" translate="no">.<a href="#path">path</a><span class="type-signature"> : string</span> </h3>
  105. <div class="description">
  106. <p>The path to the model repository.</p>
  107. <p>Default is <code>null</code>.</p>
  108. </div>
  109. </div>
  110. <h2 class="subsection-title">Methods</h2>
  111. <h3 class="name name-method" id="checkButton" translate="no">.<a href="#checkButton">checkButton</a><span class="signature">( button : <span class="param-type">Object</span> )</span> </h3>
  112. <div class="method">
  113. <div class="description">
  114. <p>Executed actions depending on the interaction state with
  115. the given button.</p>
  116. </div>
  117. <table class="params">
  118. <tbody>
  119. <tr>
  120. <td class="name">
  121. <strong>button</strong>
  122. </td>
  123. <td class="description last">
  124. <p>The button.</p>
  125. </td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. </div>
  130. <h3 class="name name-method" id="getPointerPosition" translate="no">.<a href="#getPointerPosition">getPointerPosition</a><span class="signature">()</span><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
  131. <div class="method">
  132. <div class="description">
  133. <p>Returns the pointer position which is the position of the index finger tip.</p>
  134. </div>
  135. <dl class="details">
  136. <dt class="tag-returns"><strong>Returns:</strong> The pointer position. Returns <code>null</code> if not index finger tip joint was found.</dt>
  137. </dl>
  138. </div>
  139. <h3 class="name name-method" id="intersectBoxObject" translate="no">.<a href="#intersectBoxObject">intersectBoxObject</a><span class="signature">( boxObject : <span class="param-type"><a href="Mesh.html">Mesh</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
  140. <div class="method">
  141. <div class="description">
  142. <p>Returns <code>true</code> if the current pointer position (the index finger tip) intersections
  143. with the given box object.</p>
  144. </div>
  145. <table class="params">
  146. <tbody>
  147. <tr>
  148. <td class="name">
  149. <strong>boxObject</strong>
  150. </td>
  151. <td class="description last">
  152. <p>The box object.</p>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. <dl class="details">
  158. <dt class="tag-returns"><strong>Returns:</strong> Whether an intersection was found or not.</dt>
  159. </dl>
  160. </div>
  161. <h3 class="name name-method" id="updateMatrixWorld" translate="no">.<a href="#updateMatrixWorld">updateMatrixWorld</a><span class="signature">( force : <span class="param-type">boolean</span> )</span> </h3>
  162. <div class="method">
  163. <div class="description">
  164. <p>Overwritten with a custom implementation. Makes sure the motion controller updates the mesh.</p>
  165. </div>
  166. <table class="params">
  167. <tbody>
  168. <tr>
  169. <td class="name">
  170. <strong>force</strong>
  171. </td>
  172. <td class="description last">
  173. <p>When set to <code>true</code>, a recomputation of world matrices is forced even
  174. when <a href="Object3D.html#matrixWorldAutoUpdate">Object3D#matrixWorldAutoUpdate</a> is set to <code>false</code>.</p>
  175. <p>Default is <code>false</code>.</p>
  176. </td>
  177. </tr>
  178. </tbody>
  179. </table>
  180. <dl class="details">
  181. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Object3D.html#updateMatrixWorld">Object3D#updateMatrixWorld</a></dt>
  182. </dl>
  183. </div>
  184. <h2 class="subsection-title">Source</h2>
  185. <p>
  186. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/OculusHandModel.js" translate="no" target="_blank" rel="noopener">examples/jsm/webxr/OculusHandModel.js</a>
  187. </p>
  188. </article>
  189. </section>
  190. <script src="../scripts/linenumber.js"></script>
  191. <script src="../scripts/page.js"></script>
  192. </body>
  193. </html>
粤ICP备19079148号