OrthographicTrackballControls.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. [page:EventDispatcher] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. <p>
  15. This class is a special version of [page:TrackballControls] which supports orthographic cameras.
  16. </p>
  17. </p>
  18. <h2>Example</h2>
  19. <p>[example:misc_controls_trackball_orthographic misc / controls / trackball / orthographic ]</p>
  20. <h2>Constructor</h2>
  21. <h3>[name]( [param:OrthographicCamera camera], [param:HTMLDOMElement domElement] )</h3>
  22. <p>
  23. <p>
  24. [page:OrthographicCamera camera]: The orthographic camera of the rendered scene.
  25. </p>
  26. <p>
  27. [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document,
  28. however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here.
  29. </p>
  30. <p>
  31. Creates a new instance of [name].
  32. </p>
  33. </p>
  34. <h2>Events</h2>
  35. <h3>change</h3>
  36. <p>
  37. Fires when the camera has been transformed by the controls.
  38. </p>
  39. <h3>start</h3>
  40. <p>
  41. Fires when an interaction (e.g. touch) was initiated.
  42. </p>
  43. <h3>end</h3>
  44. <p>
  45. Fires when an interaction has finished.
  46. </p>
  47. <h2>Properties</h2>
  48. <h3>[property:HTMLDOMElement domElement]</h3>
  49. <p>
  50. The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will
  51. not set up new event listeners. Default is the whole document.
  52. </p>
  53. <h3>[property:Number dynamicDampingFactor]</h3>
  54. <p>
  55. Defines the intensity of damping. Only considered if [page:.staticMoving staticMoving] is set to *false*. Default is *0.2*.
  56. </p>
  57. <h3>[property:Boolean enabled]</h3>
  58. <p>
  59. Whether or not the controls are enabled.
  60. </p>
  61. <h3>[property:Array keys]</h3>
  62. <p>
  63. This array holds keycodes for controlling interactions.
  64. <ul>
  65. <li>When the first defined key is pressed, all mouse interactions (left, middle, right) performs orbiting.</li>
  66. <li>When the second defined key is pressed, all mouse interactions (left, middle, right) performs zooming.</li>
  67. <li>When the third defined key is pressed, all mouse interactions (left, middle, right) performs panning.</li>
  68. </ul>
  69. Default is *65, 83, 68* which represents A, S, D.
  70. </p>
  71. <h3>[property:Boolean noPan]</h3>
  72. <p>
  73. Whether or not panning is disabled. Default is *false*.
  74. </p>
  75. <h3>[property:Boolean noRoll]</h3>
  76. <p>
  77. Whether or not rolling is disabled. Default is *false*.
  78. </p>
  79. <h3>[property:Boolean noRotate]</h3>
  80. <p>
  81. Whether or not rotation is disabled. Default is *false*.
  82. </p>
  83. <h3>[property:Boolean noZoom]</h3>
  84. <p>
  85. Whether or not zooming is disabled. Default is *false*.
  86. </p>
  87. <h3>[property:OrthographicCamera object]</h3>
  88. <p>
  89. The camera being controlled.
  90. </p>
  91. <h3>[property:Number panSpeed]</h3>
  92. <p>
  93. The zoom speed. Default is *0.3*.
  94. </p>
  95. <h3>[property:Number rotateSpeed]</h3>
  96. <p>
  97. The rotation speed. Default is *1.0*.
  98. </p>
  99. <h3>[property:Object screen]</h3>
  100. <p>
  101. Represents the properties of the screen. Automatically set when [page:.handleResize handleResize]() is called.
  102. <ul>
  103. <li>left: Represents the offset in pixels to the screen's left boundary.</li>
  104. <li>top: Represents the offset in pixels to the screen's top boundary.</li>
  105. <li>width: Represents the screen width in pixels.</li>
  106. <li>height: Represents the screen height in pixels.</li>
  107. </ul>
  108. </p>
  109. <h3>[property:Boolean staticMoving]</h3>
  110. <p>
  111. Whether or not damping is disabled. Default is *false*.
  112. </p>
  113. <h3>[property:Number zoomSpeed]</h3>
  114. <p>
  115. The zoom speed. Default is *1.2*.
  116. </p>
  117. <h2>Methods</h2>
  118. <h3>[method:null dispose] ()</h3>
  119. <p>
  120. Should be called if the controls is no longer required.
  121. </p>
  122. <h3>[method:null handleResize] ()</h3>
  123. <p>
  124. Should be called if the application window is resized.
  125. </p>
  126. <h3>[method:null panCamera] ()</h3>
  127. <p>
  128. Performs panning if necessary. Called by [page:.update update]().
  129. </p>
  130. <h3>[method:null reset] ()</h3>
  131. <p>
  132. Resets the controls to its initial state.
  133. </p>
  134. <h3>[method:null rotateCamera] ()</h3>
  135. <p>
  136. Rotates the camera if necessary. Called by [page:.update update]().
  137. </p>
  138. <h3>[method:null update] ()</h3>
  139. <p>
  140. Updates the controls. Usually called in the animation loop.
  141. </p>
  142. <h3>[method:null zoomCamera] ()</h3>
  143. <p>
  144. Performs zooming if necessary. Called by [page:.update update]().
  145. </p>
  146. <h2>Source</h2>
  147. <p>
  148. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js examples/js/controls/TrackballControls.js]
  149. </p>
  150. </body>
  151. </html>