2
0

WebXRManager.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. This class represents an abstraction of the WebXR Device API and is internally used by [page:WebGLRenderer].
  13. [name] also provides a public interface that allows users to enable/disable XR and perform XR related tasks like
  14. for instance retrieving controllers.
  15. </p>
  16. <h2>Properties</h2>
  17. <h3>[property:Boolean enabled]</h3>
  18. <p>
  19. This flag notifies the renderer to be ready for XR rendering. Default is *false*. Set it to *true* if you are going
  20. to use XR in your app.
  21. </p>
  22. <h3>[property:Boolean isPresenting]</h3>
  23. <p>
  24. Whether XR presentation is active or not. Default is *false*. This flag is read-only and automatically set by [name].
  25. </p>
  26. <h2>Methods</h2>
  27. <h3>[method:Group getController]( [param:Integer index] )</h3>
  28. <p>
  29. [page:Integer index] — The index of the controller. <br /><br />
  30. Returns a [page:Group] representing the so called *target ray* space of the controller.
  31. Use this space for visualizing 3D objects that support the user in pointing tasks like UI interaction.
  32. </p>
  33. <h3>[method:Group getControllerGrip]( [param:Integer index] )</h3>
  34. <p>
  35. [page:Integer index] — The index of the controller. <br /><br />
  36. Returns a [page:Group] representing the so called *grip* space of the controller.
  37. Use this space if the user is going to hold other 3D objects like a lightsaber.
  38. </p>
  39. <p>
  40. Note: If you want to show something in the user's hand AND offer a pointing ray at the same time, you'll want to attached the handheld object to the
  41. group returned by [page:.getControllerGrip]() and the ray to the group returned by [page:.getController](). The idea is to have two different groups
  42. in two different coordinate spaces for the same WebXR controller.
  43. </p>
  44. <h3>[method:void setFramebufferScaleFactor]( [param:Float framebufferScaleFactor] )</h3>
  45. <p>
  46. [page:Float framebufferScaleFactor] — The framebuffer scale factor to set.<br /><br />
  47. Specifies the scaling factor to use when determining the size of the framebuffer when rendering to a XR device.
  48. The value is relative to the default XR device display resolution. Default is *1*. A value of *0.5* would specify
  49. a framebuffer with 50% of the display's native resolution.
  50. </p>
  51. <p>
  52. Note: It is not possible to change the framebuffer scale factor while presenting XR content.
  53. </p>
  54. <h3>[method:void setReferenceSpaceType]( [param:String referenceSpaceType] )</h3>
  55. <p>
  56. [page:String referenceSpaceType] — The reference space type to set.<br /><br />
  57. Can be used to configure a spatial relationship with the user's physical environment. Depending on how the user moves in 3D space, setting an
  58. appropriate reference space can improve tracking. Default is *local-floor*.
  59. Please check out the [link:https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType MDN] for possible values and their use cases.
  60. </p>
  61. <p>
  62. Note: It is not possible to change the reference space type while presenting XR content.
  63. </p>
  64. <h2>Source</h2>
  65. <p>
  66. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  67. </p>
  68. </body>
  69. </html>