DeviceOrientationControls.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. Can be used to orient the camera based on the mobile device's orientation.
  14. </p>
  15. <h2>Example</h2>
  16. <p>[example:misc_controls_deviceorientation misc / controls / deviceorientation ]</p>
  17. <h2>Constructor</h2>
  18. <h3>[name]( [param:Camera object] )</h3>
  19. <p>
  20. <p>
  21. [page:Camera object]: The camera to be controlled.
  22. </p>
  23. <p>
  24. Creates a new instance of [name].
  25. </p>
  26. </p>
  27. <h2>Properties</h2>
  28. <h3>[property:Number alphaOffset]</h3>
  29. <p>
  30. The alpha offset in radians. Default is *0*.
  31. </p>
  32. <h3>[property:Object deviceOrientation]</h3>
  33. <p>
  34. The current *deviceorientation* event object.
  35. </p>
  36. <h3>[property:Boolean enabled]</h3>
  37. <p>
  38. Whether or not the controls are enabled.
  39. </p>
  40. <h3>[property:Camera object]</h3>
  41. <p>
  42. The camera to be controlled.
  43. </p>
  44. <h3>[property:Number screenOrientation]</h3>
  45. <p>
  46. The orientation in degrees (in 90-degree increments) of the viewport relative to the device's natural orientation. Default is *0*.
  47. </p>
  48. <h2>Methods</h2>
  49. <h3>[method:null connect] ()</h3>
  50. <p>
  51. Adds the event listeners of the controls and enables it.
  52. </p>
  53. <h3>[method:null disconnect] ()</h3>
  54. <p>
  55. Removes the event listeners of the controls and disables it.
  56. </p>
  57. <h3>[method:null dispose] ()</h3>
  58. <p>
  59. Should be called if the controls is no longer required.
  60. </p>
  61. <h3>[method:null update] ()</h3>
  62. <p>
  63. Updates the controls. Usually called in the animation loop.
  64. </p>
  65. <h2>Source</h2>
  66. <p>
  67. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/DeviceOrientationControls.js examples/js/controls/DeviceOrientationControls.js]
  68. </p>
  69. </body>
  70. </html>