FlyControls.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. [name] enables a navigation similar to fly modes in DCC tools like Blender. You can arbitrarily transform the camera in
  13. 3D space without any limitations (e.g. focus on a specific target).
  14. </p>
  15. <h2>Import</h2>
  16. <p>
  17. [name] is an add-on, and must be imported explicitly.
  18. See [link:#manual/introduction/Installation Installation / Addons].
  19. </p>
  20. <code>
  21. import { FlyControls } from 'three/addons/controls/FlyControls.js';
  22. </code>
  23. <h2>Examples</h2>
  24. <p>[example:misc_controls_fly misc / controls / fly ]</p>
  25. <h2>Constructor</h2>
  26. <h3>[name]( [param:Camera object], [param:HTMLDOMElement domElement] )</h3>
  27. <p>
  28. [page:Camera object]: The camera to be controlled.
  29. </p>
  30. <p>
  31. [page:HTMLDOMElement domElement]: The HTML element used for event listeners.
  32. </p>
  33. <p>
  34. Creates a new instance of [name].
  35. </p>
  36. <h2>Events</h2>
  37. <h3>change</h3>
  38. <p>
  39. Fires when the camera has been transformed by the controls.
  40. </p>
  41. <h2>Properties</h2>
  42. <h3>[property:Boolean autoForward]</h3>
  43. <p>
  44. If set to `true`, the camera automatically moves forward (and does not stop) when initially translated. Default is `false`.
  45. </p>
  46. <h3>[property:HTMLDOMElement domElement]</h3>
  47. <p>
  48. The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will
  49. not set up new event listeners.
  50. </p>
  51. <h3>[property:Boolean dragToLook]</h3>
  52. <p>
  53. If set to `true`, you can only look around by performing a drag interaction. Default is `false`.
  54. </p>
  55. <h3>[property:Boolean enabled]</h3>
  56. <p>
  57. When set to `false`, the controls will not respond to user input. Default is `true`.
  58. </p>
  59. <h3>[property:Number movementSpeed]</h3>
  60. <p>
  61. The movement speed. Default is *1*.
  62. </p>
  63. <h3>[property:Camera object]</h3>
  64. <p>
  65. The camera to be controlled.
  66. </p>
  67. <h3>[property:Number rollSpeed]</h3>
  68. <p>
  69. The rotation speed. Default is `0.005`.
  70. </p>
  71. <h2>Methods</h2>
  72. <h3>[method:undefined dispose] ()</h3>
  73. <p>
  74. Should be called if the controls is no longer required.
  75. </p>
  76. <h3>[method:undefined update] ( [param:Number delta] )</h3>
  77. <p>
  78. <p>
  79. [page:Number delta]: Time delta value.
  80. </p>
  81. <p>
  82. Updates the controls. Usually called in the animation loop.
  83. </p>
  84. </p>
  85. <h2>Source</h2>
  86. <p>
  87. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/FlyControls.js examples/jsm/controls/FlyControls.js]
  88. </p>
  89. </body>
  90. </html>