XRManager.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>XRManager - 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">XRManager</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>The XR manager is built on top of the WebXR Device API to
  17. manage XR sessions with renderer backends.</p></div>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="XRManager" translate="no">new <a href="#XRManager">XRManager</a><span class="signature">( renderer : <span class="param-type"><a href="Renderer.html">Renderer</a></span>, multiview : <span class="param-type">boolean</span> )</span> </h3>
  23. <div class="method">
  24. <div class="description">
  25. <p>Constructs a new XR manager.</p>
  26. </div>
  27. <table class="params">
  28. <tbody>
  29. <tr>
  30. <td class="name">
  31. <strong translate="no">renderer</strong>
  32. </td>
  33. <td class="description last">
  34. <p>The renderer.</p>
  35. </td>
  36. </tr>
  37. <tr>
  38. <td class="name">
  39. <strong translate="no">multiview</strong>
  40. </td>
  41. <td class="description last">
  42. <p>Enables multiview if the device supports it.</p>
  43. <p>Default is <code>false</code>.</p>
  44. </td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. </div>
  49. </div>
  50. <h2 class="subsection-title">Properties</h2>
  51. <div class="member">
  52. <h3 class="name" id="cameraAutoUpdate" translate="no">.<a href="#cameraAutoUpdate">cameraAutoUpdate</a><span class="type-signature"> : boolean</span> </h3>
  53. <div class="description">
  54. <p>Whether the XR camera should automatically be updated or not.</p>
  55. <p>Default is <code>true</code>.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <h3 class="name" id="enabled" translate="no">.<a href="#enabled">enabled</a><span class="type-signature"> : boolean</span> </h3>
  60. <div class="description">
  61. <p>This flag globally enables XR rendering.</p>
  62. <p>Default is <code>false</code>.</p>
  63. </div>
  64. </div>
  65. <div class="member">
  66. <h3 class="name" id="isPresenting" translate="no">.<a href="#isPresenting">isPresenting</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  67. <div class="description">
  68. <p>Whether the XR device is currently presenting or not.</p>
  69. <p>Default is <code>false</code>.</p>
  70. </div>
  71. </div>
  72. <h2 class="subsection-title">Methods</h2>
  73. <h3 class="name name-method" id="createCylinderLayer" translate="no">.<a href="#createCylinderLayer">createCylinderLayer</a><span class="signature">( radius : <span class="param-type">number</span>, centralAngle : <span class="param-type">number</span>, aspectratio : <span class="param-type">number</span>, translation : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, quaternion : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span>, pixelwidth : <span class="param-type">number</span>, pixelheight : <span class="param-type">number</span>, rendercall : <span class="param-type">function</span>, attributes : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> </h3>
  74. <div class="method">
  75. <div class="description">
  76. <p>This method can be used in XR applications to create a cylindrical layer that presents a separate
  77. rendered scene.</p>
  78. </div>
  79. <table class="params">
  80. <tbody>
  81. <tr>
  82. <td class="name">
  83. <strong translate="no">radius</strong>
  84. </td>
  85. <td class="description last">
  86. <p>The radius of the cylinder in world units.</p>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td class="name">
  91. <strong translate="no">centralAngle</strong>
  92. </td>
  93. <td class="description last">
  94. <p>The central angle of the cylinder in radians.</p>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td class="name">
  99. <strong translate="no">aspectratio</strong>
  100. </td>
  101. <td class="description last">
  102. <p>The aspect ratio.</p>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td class="name">
  107. <strong translate="no">translation</strong>
  108. </td>
  109. <td class="description last">
  110. <p>The position/translation of the layer plane in world units.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong translate="no">quaternion</strong>
  116. </td>
  117. <td class="description last">
  118. <p>The orientation of the layer plane expressed as a quaternion.</p>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td class="name">
  123. <strong translate="no">pixelwidth</strong>
  124. </td>
  125. <td class="description last">
  126. <p>The width of the layer's render target in pixels.</p>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td class="name">
  131. <strong translate="no">pixelheight</strong>
  132. </td>
  133. <td class="description last">
  134. <p>The height of the layer's render target in pixels.</p>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td class="name">
  139. <strong translate="no">rendercall</strong>
  140. </td>
  141. <td class="description last">
  142. <p>A callback function that renders the layer. Similar to code in
  143. the default animation loop, this method can be used to update/transform 3D object in the layer's scene.</p>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td class="name">
  148. <strong translate="no">attributes</strong>
  149. </td>
  150. <td class="description last">
  151. <p>Allows to configure the layer's render target.</p>
  152. <p>Default is <code>{}</code>.</p>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. <dl class="details">
  158. <dt class="tag-returns"><strong>Returns:</strong> A mesh representing the cylindrical XR layer. This mesh should be added to the XR scene.</dt>
  159. </dl>
  160. </div>
  161. <h3 class="name name-method" id="createQuadLayer" translate="no">.<a href="#createQuadLayer">createQuadLayer</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, translation : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, quaternion : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span>, pixelwidth : <span class="param-type">number</span>, pixelheight : <span class="param-type">number</span>, rendercall : <span class="param-type">function</span>, attributes : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> </h3>
  162. <div class="method">
  163. <div class="description">
  164. <p>This method can be used in XR applications to create a quadratic layer that presents a separate
  165. rendered scene.</p>
  166. </div>
  167. <table class="params">
  168. <tbody>
  169. <tr>
  170. <td class="name">
  171. <strong translate="no">width</strong>
  172. </td>
  173. <td class="description last">
  174. <p>The width of the layer plane in world units.</p>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td class="name">
  179. <strong translate="no">height</strong>
  180. </td>
  181. <td class="description last">
  182. <p>The height of the layer plane in world units.</p>
  183. </td>
  184. </tr>
  185. <tr>
  186. <td class="name">
  187. <strong translate="no">translation</strong>
  188. </td>
  189. <td class="description last">
  190. <p>The position/translation of the layer plane in world units.</p>
  191. </td>
  192. </tr>
  193. <tr>
  194. <td class="name">
  195. <strong translate="no">quaternion</strong>
  196. </td>
  197. <td class="description last">
  198. <p>The orientation of the layer plane expressed as a quaternion.</p>
  199. </td>
  200. </tr>
  201. <tr>
  202. <td class="name">
  203. <strong translate="no">pixelwidth</strong>
  204. </td>
  205. <td class="description last">
  206. <p>The width of the layer's render target in pixels.</p>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td class="name">
  211. <strong translate="no">pixelheight</strong>
  212. </td>
  213. <td class="description last">
  214. <p>The height of the layer's render target in pixels.</p>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td class="name">
  219. <strong translate="no">rendercall</strong>
  220. </td>
  221. <td class="description last">
  222. <p>A callback function that renders the layer. Similar to code in
  223. the default animation loop, this method can be used to update/transform 3D object in the layer's scene.</p>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td class="name">
  228. <strong translate="no">attributes</strong>
  229. </td>
  230. <td class="description last">
  231. <p>Allows to configure the layer's render target.</p>
  232. <p>Default is <code>{}</code>.</p>
  233. </td>
  234. </tr>
  235. </tbody>
  236. </table>
  237. <dl class="details">
  238. <dt class="tag-returns"><strong>Returns:</strong> A mesh representing the quadratic XR layer. This mesh should be added to the XR scene.</dt>
  239. </dl>
  240. </div>
  241. <h3 class="name name-method" id="foveateBoundTexture" translate="no">.<a href="#foveateBoundTexture">foveateBoundTexture</a><span class="signature">( renderTarget : <span class="param-type"><a href="RenderTarget.html">RenderTarget</a></span> )</span> </h3>
  242. <div class="method">
  243. <div class="description">
  244. <p>Applies WebXR fixed foveation to the internal post-processing render target
  245. used by the first XR render pass before compositing into a projection layer.</p>
  246. <p>Browser-side <code>XRWebGLBinding.foveateBoundTexture()</code> failures are treated as
  247. non-fatal so they do not interrupt rendering.</p>
  248. </div>
  249. <table class="params">
  250. <tbody>
  251. <tr>
  252. <td class="name">
  253. <strong translate="no">renderTarget</strong>
  254. </td>
  255. <td class="description last">
  256. <p>The internal render target.</p>
  257. </td>
  258. </tr>
  259. </tbody>
  260. </table>
  261. </div>
  262. <h3 class="name name-method" id="getBaseLayer" translate="no">.<a href="#getBaseLayer">getBaseLayer</a><span class="signature">()</span><span class="type-signature"> : XRWebGLLayer | XRProjectionLayer</span> </h3>
  263. <div class="method">
  264. <div class="description">
  265. <p>Returns the current base layer.</p>
  266. <p>This is an <code>XRProjectionLayer</code> when the targeted XR device supports the
  267. WebXR Layers API, or an <code>XRWebGLLayer</code> otherwise.</p>
  268. </div>
  269. <dl class="details">
  270. <dt class="tag-returns"><strong>Returns:</strong> The XR base layer.</dt>
  271. </dl>
  272. </div>
  273. <h3 class="name name-method" id="getBinding" translate="no">.<a href="#getBinding">getBinding</a><span class="signature">()</span><span class="type-signature"> : XRWebGLBinding</span> </h3>
  274. <div class="method">
  275. <div class="description">
  276. <p>Returns the current XR binding.</p>
  277. <p>Creates a new binding if needed and the browser is
  278. capable of doing so.</p>
  279. </div>
  280. <dl class="details">
  281. <dt class="tag-returns"><strong>Returns:</strong> The XR binding. Returns <code>null</code> if one cannot be created.</dt>
  282. </dl>
  283. </div>
  284. <h3 class="name name-method" id="getCamera" translate="no">.<a href="#getCamera">getCamera</a><span class="signature">()</span><span class="type-signature"> : <a href="ArrayCamera.html">ArrayCamera</a></span> </h3>
  285. <div class="method">
  286. <div class="description">
  287. <p>Returns the XR camera.</p>
  288. </div>
  289. <dl class="details">
  290. <dt class="tag-returns"><strong>Returns:</strong> The XR camera.</dt>
  291. </dl>
  292. </div>
  293. <h3 class="name name-method" id="getController" translate="no">.<a href="#getController">getController</a><span class="signature">( index : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Group.html">Group</a></span> </h3>
  294. <div class="method">
  295. <div class="description">
  296. <p>Returns an instance of <code>THREE.Group</code> that represents the transformation
  297. of a XR controller in target ray space. The requested controller is defined
  298. by the given index.</p>
  299. </div>
  300. <table class="params">
  301. <tbody>
  302. <tr>
  303. <td class="name">
  304. <strong translate="no">index</strong>
  305. </td>
  306. <td class="description last">
  307. <p>The index of the XR controller.</p>
  308. </td>
  309. </tr>
  310. </tbody>
  311. </table>
  312. <dl class="details">
  313. <dt class="tag-returns"><strong>Returns:</strong> A group that represents the controller's transformation.</dt>
  314. </dl>
  315. </div>
  316. <h3 class="name name-method" id="getControllerGrip" translate="no">.<a href="#getControllerGrip">getControllerGrip</a><span class="signature">( index : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Group.html">Group</a></span> </h3>
  317. <div class="method">
  318. <div class="description">
  319. <p>Returns an instance of <code>THREE.Group</code> that represents the transformation
  320. of a XR controller in grip space. The requested controller is defined
  321. by the given index.</p>
  322. </div>
  323. <table class="params">
  324. <tbody>
  325. <tr>
  326. <td class="name">
  327. <strong translate="no">index</strong>
  328. </td>
  329. <td class="description last">
  330. <p>The index of the XR controller.</p>
  331. </td>
  332. </tr>
  333. </tbody>
  334. </table>
  335. <dl class="details">
  336. <dt class="tag-returns"><strong>Returns:</strong> A group that represents the controller's transformation.</dt>
  337. </dl>
  338. </div>
  339. <h3 class="name name-method" id="getEnvironmentBlendMode" translate="no">.<a href="#getEnvironmentBlendMode">getEnvironmentBlendMode</a><span class="signature">()</span><span class="type-signature"> : 'opaque' | 'additive' | 'alpha-blend' | undefined</span> </h3>
  340. <div class="method">
  341. <div class="description">
  342. <p>Returns the environment blend mode from the current XR session.</p>
  343. </div>
  344. <dl class="details">
  345. <dt class="tag-returns"><strong>Returns:</strong> The environment blend mode. Returns <code>undefined</code> when used outside of a XR session.</dt>
  346. </dl>
  347. </div>
  348. <h3 class="name name-method" id="getFoveation" translate="no">.<a href="#getFoveation">getFoveation</a><span class="signature">()</span><span class="type-signature"> : number | undefined</span> </h3>
  349. <div class="method">
  350. <div class="description">
  351. <p>Returns the foveation value.</p>
  352. </div>
  353. <dl class="details">
  354. <dt class="tag-returns"><strong>Returns:</strong> The foveation value.</dt>
  355. </dl>
  356. </div>
  357. <h3 class="name name-method" id="getFrame" translate="no">.<a href="#getFrame">getFrame</a><span class="signature">()</span><span class="type-signature"> : XRFrame</span> </h3>
  358. <div class="method">
  359. <div class="description">
  360. <p>Returns the current XR frame.</p>
  361. </div>
  362. <dl class="details">
  363. <dt class="tag-returns"><strong>Returns:</strong> The XR frame. Returns <code>null</code> when used outside a XR session.</dt>
  364. </dl>
  365. </div>
  366. <h3 class="name name-method" id="getFramebufferScaleFactor" translate="no">.<a href="#getFramebufferScaleFactor">getFramebufferScaleFactor</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  367. <div class="method">
  368. <div class="description">
  369. <p>Returns the framebuffer scale factor.</p>
  370. </div>
  371. <dl class="details">
  372. <dt class="tag-returns"><strong>Returns:</strong> The framebuffer scale factor.</dt>
  373. </dl>
  374. </div>
  375. <h3 class="name name-method" id="getHand" translate="no">.<a href="#getHand">getHand</a><span class="signature">( index : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Group.html">Group</a></span> </h3>
  376. <div class="method">
  377. <div class="description">
  378. <p>Returns an instance of <code>THREE.Group</code> that represents the transformation
  379. of a XR controller in hand space. The requested controller is defined
  380. by the given index.</p>
  381. </div>
  382. <table class="params">
  383. <tbody>
  384. <tr>
  385. <td class="name">
  386. <strong translate="no">index</strong>
  387. </td>
  388. <td class="description last">
  389. <p>The index of the XR controller.</p>
  390. </td>
  391. </tr>
  392. </tbody>
  393. </table>
  394. <dl class="details">
  395. <dt class="tag-returns"><strong>Returns:</strong> A group that represents the controller's transformation.</dt>
  396. </dl>
  397. </div>
  398. <h3 class="name name-method" id="getReferenceSpace" translate="no">.<a href="#getReferenceSpace">getReferenceSpace</a><span class="signature">()</span><span class="type-signature"> : XRReferenceSpace</span> </h3>
  399. <div class="method">
  400. <div class="description">
  401. <p>Returns the XR reference space.</p>
  402. </div>
  403. <dl class="details">
  404. <dt class="tag-returns"><strong>Returns:</strong> The XR reference space.</dt>
  405. </dl>
  406. </div>
  407. <h3 class="name name-method" id="getReferenceSpaceType" translate="no">.<a href="#getReferenceSpaceType">getReferenceSpaceType</a><span class="signature">()</span><span class="type-signature"> : XRReferenceSpaceType</span> </h3>
  408. <div class="method">
  409. <div class="description">
  410. <p>Returns the reference space type.</p>
  411. </div>
  412. <dl class="details">
  413. <dt class="tag-returns"><strong>Returns:</strong> The reference space type.</dt>
  414. </dl>
  415. </div>
  416. <h3 class="name name-method" id="getSession" translate="no">.<a href="#getSession">getSession</a><span class="signature">()</span><span class="type-signature"> : XRSession</span> </h3>
  417. <div class="method">
  418. <div class="description">
  419. <p>Returns the current XR session.</p>
  420. </div>
  421. <dl class="details">
  422. <dt class="tag-returns"><strong>Returns:</strong> The XR session. Returns <code>null</code> when used outside a XR session.</dt>
  423. </dl>
  424. </div>
  425. <h3 class="name name-method" id="getWebGPUBinding" translate="no">.<a href="#getWebGPUBinding">getWebGPUBinding</a><span class="signature">()</span><span class="type-signature"> : XRGPUBinding</span> </h3>
  426. <div class="method">
  427. <div class="description">
  428. <p>Returns the current XR WebGPU binding.</p>
  429. <p>Creates a new binding if needed and the browser is
  430. capable of doing so.</p>
  431. </div>
  432. <dl class="details">
  433. <dt class="tag-returns"><strong>Returns:</strong> The XR WebGPU binding. Returns <code>null</code> if one cannot be created.</dt>
  434. </dl>
  435. </div>
  436. <h3 class="name name-method" id="renderLayers" translate="no">.<a href="#renderLayers">renderLayers</a><span class="signature">()</span> </h3>
  437. <div class="method">
  438. <div class="description">
  439. <p>Renders the XR layers that have been previously added to the scene.</p>
  440. <p>This method is usually called in your animation loop before rendering
  441. the actual scene via <code>renderer.render( scene, camera );</code>.</p>
  442. </div>
  443. </div>
  444. <h3 class="name name-method" id="setFoveation" translate="no">.<a href="#setFoveation">setFoveation</a><span class="signature">( foveation : <span class="param-type">number</span> )</span> </h3>
  445. <div class="method">
  446. <div class="description">
  447. <p>Sets the foveation value.</p>
  448. </div>
  449. <table class="params">
  450. <tbody>
  451. <tr>
  452. <td class="name">
  453. <strong translate="no">foveation</strong>
  454. </td>
  455. <td class="description last">
  456. <p>A number in the range <code>[0,1]</code> where <code>0</code> means no foveation (full resolution)
  457. and <code>1</code> means maximum foveation (the edges render at lower resolution).</p>
  458. </td>
  459. </tr>
  460. </tbody>
  461. </table>
  462. </div>
  463. <h3 class="name name-method" id="setFramebufferScaleFactor" translate="no">.<a href="#setFramebufferScaleFactor">setFramebufferScaleFactor</a><span class="signature">( factor : <span class="param-type">number</span> )</span> </h3>
  464. <div class="method">
  465. <div class="description">
  466. <p>Sets the framebuffer scale factor.</p>
  467. <p>This method can not be used during a XR session.</p>
  468. </div>
  469. <table class="params">
  470. <tbody>
  471. <tr>
  472. <td class="name">
  473. <strong translate="no">factor</strong>
  474. </td>
  475. <td class="description last">
  476. <p>The framebuffer scale factor.</p>
  477. </td>
  478. </tr>
  479. </tbody>
  480. </table>
  481. </div>
  482. <h3 class="name name-method" id="setReferenceSpace" translate="no">.<a href="#setReferenceSpace">setReferenceSpace</a><span class="signature">( space : <span class="param-type">XRReferenceSpace</span> )</span> </h3>
  483. <div class="method">
  484. <div class="description">
  485. <p>Sets a custom XR reference space.</p>
  486. </div>
  487. <table class="params">
  488. <tbody>
  489. <tr>
  490. <td class="name">
  491. <strong translate="no">space</strong>
  492. </td>
  493. <td class="description last">
  494. <p>The XR reference space.</p>
  495. </td>
  496. </tr>
  497. </tbody>
  498. </table>
  499. </div>
  500. <h3 class="name name-method" id="setReferenceSpaceType" translate="no">.<a href="#setReferenceSpaceType">setReferenceSpaceType</a><span class="signature">( type : <span class="param-type">XRReferenceSpaceType</span> )</span> </h3>
  501. <div class="method">
  502. <div class="description">
  503. <p>Sets the reference space type.</p>
  504. <p>This method can not be used during a XR session.</p>
  505. </div>
  506. <table class="params">
  507. <tbody>
  508. <tr>
  509. <td class="name">
  510. <strong translate="no">type</strong>
  511. </td>
  512. <td class="description last">
  513. <p>The reference space type.</p>
  514. </td>
  515. </tr>
  516. </tbody>
  517. </table>
  518. </div>
  519. <h3 class="name name-method" id="setSession" translate="no">.<a href="#setSession">setSession</a><span class="signature">( session : <span class="param-type">XRSession</span> )</span><span class="type-signature"> : Promise</span> <span class="type-signature">(async) </span></h3>
  520. <div class="method">
  521. <div class="description">
  522. <p>After a XR session has been requested usually with one of the <code>*Button</code> modules, it
  523. is injected into the renderer with this method. This method triggers the start of
  524. the actual XR rendering.</p>
  525. </div>
  526. <table class="params">
  527. <tbody>
  528. <tr>
  529. <td class="name">
  530. <strong translate="no">session</strong>
  531. </td>
  532. <td class="description last">
  533. <p>The XR session to set.</p>
  534. </td>
  535. </tr>
  536. </tbody>
  537. </table>
  538. <dl class="details">
  539. <dt class="tag-returns"><strong>Returns:</strong> A Promise that resolves when the session has been set.</dt>
  540. </dl>
  541. </div>
  542. <h3 class="name name-method" id="updateCamera" translate="no">.<a href="#updateCamera">updateCamera</a><span class="signature">( camera : <span class="param-type"><a href="PerspectiveCamera.html">PerspectiveCamera</a></span> )</span> </h3>
  543. <div class="method">
  544. <div class="description">
  545. <p>This method is called by the renderer per frame and updates the XR camera
  546. and it sub cameras based on the given camera. The given camera is the &quot;user&quot;
  547. camera created on application level and used for non-XR rendering.</p>
  548. </div>
  549. <table class="params">
  550. <tbody>
  551. <tr>
  552. <td class="name">
  553. <strong translate="no">camera</strong>
  554. </td>
  555. <td class="description last">
  556. <p>The camera.</p>
  557. </td>
  558. </tr>
  559. </tbody>
  560. </table>
  561. </div>
  562. <h3 class="name name-method" id="useMultiview" translate="no">.<a href="#useMultiview">useMultiview</a><span class="signature">()</span><span class="type-signature"> : boolean</span> </h3>
  563. <div class="method">
  564. <div class="description">
  565. <p>Returns <code>true</code> if the engine renders to a multiview target.</p>
  566. </div>
  567. <dl class="details">
  568. <dt class="tag-returns"><strong>Returns:</strong> Whether the engine renders to a multiview render target or not.</dt>
  569. </dl>
  570. </div>
  571. <h2 class="subsection-title">Source</h2>
  572. <p>
  573. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/XRManager.js" translate="no" target="_blank" rel="noopener">src/renderers/common/XRManager.js</a>
  574. </p>
  575. </article>
  576. </section>
  577. <script src="../scripts/linenumber.js"></script>
  578. <script src="../scripts/page.js"></script>
  579. </body>
  580. </html>
粤ICP备19079148号