WebXRManager.html 3.3 KB

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