OculusHandModel.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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">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">Group</span>, loader : <span class="param-type">Loader</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"><code>controller</code></td>
  33. <td class="description last"><p>The hand controller.</p></td>
  34. </tr>
  35. <tr>
  36. <td class="name"><code>loader</code></td>
  37. <td class="description last"><p>A loader that is used to load hand models.<br/>Default is <code>null</code>.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>onLoad</code></td>
  41. <td class="description last"><p>A callback that is executed when a hand model has been loaded.<br/>Default is <code>null</code>.</p></td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Properties</h2>
  48. <div class="member">
  49. <h3 class="name" id="controller" translate="no">.<a href="#controller">controller</a><span class="type-signature"> : <a href="Group.html">Group</a></span> </h3>
  50. <div class="description">
  51. <p>The hand controller.</p>
  52. </div>
  53. </div>
  54. <div class="member">
  55. <h3 class="name" id="envMap" translate="no">.<a href="#envMap">envMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  56. <div class="description">
  57. <p>The model's environment map.<br/>Default is <code>null</code>.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="loader" translate="no">.<a href="#loader">loader</a><span class="type-signature"> : <a href="Loader.html">Loader</a></span> </h3>
  62. <div class="description">
  63. <p>A loader that is used to load hand models.<br/>Default is <code>null</code>.</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <h3 class="name" id="mesh" translate="no">.<a href="#mesh">mesh</a><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> </h3>
  68. <div class="description">
  69. <p>The model mesh.<br/>Default is <code>null</code>.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="motionController" translate="no">.<a href="#motionController">motionController</a><span class="type-signature"> : MotionController</span> </h3>
  74. <div class="description">
  75. <p>The motion controller.<br/>Default is <code>null</code>.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="onLoad" translate="no">.<a href="#onLoad">onLoad</a><span class="type-signature"> : function</span> </h3>
  80. <div class="description">
  81. <p>A callback that is executed when a hand model has been loaded.<br/>Default is <code>null</code>.</p>
  82. </div>
  83. </div>
  84. <div class="member">
  85. <h3 class="name" id="path" translate="no">.<a href="#path">path</a><span class="type-signature"> : string</span> </h3>
  86. <div class="description">
  87. <p>The path to the model repository.<br/>Default is <code>null</code>.</p>
  88. </div>
  89. </div>
  90. <h2 class="subsection-title">Methods</h2>
  91. <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>
  92. <div class="method">
  93. <div class="description">
  94. <p>Executed actions depending on the interaction state with
  95. the given button.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name"><code>button</code></td>
  101. <td class="description last"><p>The button.</p></td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. </div>
  106. <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>
  107. <div class="method">
  108. <div class="description">
  109. <p>Returns the pointer position which is the position of the index finger tip.</p>
  110. </div>
  111. <dl class="details">
  112. <dt class="tag-returns"><strong>Returns:</strong> The pointer position. Returns <code>null</code> if not index finger tip joint was found.</dt>
  113. </dl>
  114. </div>
  115. <h3 class="name name-method" id="intersectBoxObject" translate="no">.<a href="#intersectBoxObject">intersectBoxObject</a><span class="signature">( boxObject : <span class="param-type">Mesh</span> )</span><span class="type-signature"> : boolean</span> </h3>
  116. <div class="method">
  117. <div class="description">
  118. <p>Returns <code>true</code> if the current pointer position (the index finger tip) intersections
  119. with the given box object.</p>
  120. </div>
  121. <table class="params">
  122. <tbody>
  123. <tr>
  124. <td class="name"><code>boxObject</code></td>
  125. <td class="description last"><p>The box object.</p></td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <dl class="details">
  130. <dt class="tag-returns"><strong>Returns:</strong> Whether an intersection was found or not.</dt>
  131. </dl>
  132. </div>
  133. <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>
  134. <div class="method">
  135. <div class="description">
  136. <p>Overwritten with a custom implementation. Makes sure the motion controller updates the mesh.</p>
  137. </div>
  138. <table class="params">
  139. <tbody>
  140. <tr>
  141. <td class="name"><code>force</code></td>
  142. <td class="description last"><p>When set to <code>true</code>, a recomputation of world matrices is forced even
  143. when <a href="Object3D.html#matrixWorldAutoUpdate">Object3D#matrixWorldAutoUpdate</a> is set to <code>false</code>.<br/>Default is <code>false</code>.</p></td>
  144. </tr>
  145. </tbody>
  146. </table>
  147. <dl class="details">
  148. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Object3D.html#updateMatrixWorld">Object3D#updateMatrixWorld</a></dt>
  149. </dl>
  150. </div>
  151. <h2 class="subsection-title">Source</h2>
  152. <p>
  153. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/OculusHandModel.js" target="_blank" rel="noopener" translate="no">examples/jsm/webxr/OculusHandModel.js</a>
  154. </p>
  155. </article>
  156. </section>
  157. <script src="../scripts/linenumber.js"></script>
  158. <script src="../scripts/page.js"></script>
  159. </body>
  160. </html>
粤ICP备19079148号