OrbitControls.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>OrbitControls - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Controls.html">Controls</a> → </p>
  13. <h1 translate="no">OrbitControls</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Orbit controls allow the camera to orbit around a target.</p>
  17. <p>OrbitControls performs orbiting, dollying (zooming), and panning. Unlike <a href="TrackballControls.html">TrackballControls</a>,
  18. it maintains the &quot;up&quot; direction <code>object.up</code> (+Y by default).</p>
  19. <ul>
  20. <li>Orbit: Left mouse / touch: one-finger move.</li>
  21. <li>Zoom: Middle mouse, or mousewheel / touch: two-finger spread or squish.</li>
  22. <li>Pan: Right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move.</li>
  23. </ul></div>
  24. <h2>Code Example</h2>
  25. <div translate="no"><pre><code class="language-js">const controls = new OrbitControls( camera, renderer.domElement );
  26. // controls.update() must be called after any manual changes to the camera's transform
  27. camera.position.set( 0, 20, 100 );
  28. controls.update();
  29. function animate() {
  30. // required if controls.enableDamping or controls.autoRotate are set to true
  31. controls.update();
  32. renderer.render( scene, camera );
  33. }
  34. </code></pre></div>
  35. </header>
  36. <article>
  37. <h2 class="subsection-title">Import</h2>
  38. <p><span translate="no">OrbitControls</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  39. <pre><code class="language-js">import { OrbitControls } from 'three/addons/controls/OrbitControls.js';</code></pre>
  40. <div class="container-overview">
  41. <h2>Constructor</h2>
  42. <h3 class="name name-method" id="OrbitControls" translate="no">new <a href="#OrbitControls">OrbitControls</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, domElement : <span class="param-type">HTMLElement</span> )</span> </h3>
  43. <div class="method">
  44. <div class="description">
  45. <p>Constructs a new controls instance.</p>
  46. </div>
  47. <table class="params">
  48. <tbody>
  49. <tr>
  50. <td class="name">
  51. <strong translate="no">object</strong>
  52. </td>
  53. <td class="description last">
  54. <p>The object that is managed by the controls.</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td class="name">
  59. <strong translate="no">domElement</strong>
  60. </td>
  61. <td class="description last">
  62. <p>The HTML element used for event listeners.</p>
  63. <p>Default is <code>null</code>.</p>
  64. </td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Properties</h2>
  71. <div class="member">
  72. <h3 class="name" id="autoRotate" translate="no">.<a href="#autoRotate">autoRotate</a><span class="type-signature"> : boolean</span> </h3>
  73. <div class="description">
  74. <p>Set to true to automatically rotate around the target</p>
  75. <p>Note that if this is enabled, you must call <code>update()</code> in your animation loop.
  76. If you want the auto-rotate speed to be independent of the frame rate (the refresh
  77. rate of the display), you must pass the time <code>deltaTime</code>, in seconds, to <code>update()</code>.</p>
  78. <p>Default is <code>false</code>.</p>
  79. </div>
  80. </div>
  81. <div class="member">
  82. <h3 class="name" id="autoRotateSpeed" translate="no">.<a href="#autoRotateSpeed">autoRotateSpeed</a><span class="type-signature"> : number</span> </h3>
  83. <div class="description">
  84. <p>How fast to rotate around the target if <code>autoRotate</code> is <code>true</code>. The default equates to 30 seconds
  85. per orbit at 60fps.</p>
  86. <p>Note that if <code>autoRotate</code> is enabled, you must call <code>update()</code> in your animation loop.</p>
  87. <p>Default is <code>2</code>.</p>
  88. </div>
  89. </div>
  90. <div class="member">
  91. <h3 class="name" id="cursor" translate="no">.<a href="#cursor">cursor</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
  92. <div class="description">
  93. <p>The focus point of the <code>minTargetRadius</code> and <code>maxTargetRadius</code> limits.
  94. It can be updated manually at any point to change the center of interest
  95. for the <code>target</code>.</p>
  96. </div>
  97. </div>
  98. <div class="member">
  99. <h3 class="name" id="dampingFactor" translate="no">.<a href="#dampingFactor">dampingFactor</a><span class="type-signature"> : number</span> </h3>
  100. <div class="description">
  101. <p>The damping inertia used if <code>enableDamping</code> is set to <code>true</code>.</p>
  102. <p>Note that for this to work, you must call <code>update()</code> in your animation loop.</p>
  103. <p>Default is <code>0.05</code>.</p>
  104. </div>
  105. </div>
  106. <div class="member">
  107. <h3 class="name" id="enableDamping" translate="no">.<a href="#enableDamping">enableDamping</a><span class="type-signature"> : boolean</span> </h3>
  108. <div class="description">
  109. <p>Set to <code>true</code> to enable damping (inertia), which can be used to give a sense of weight
  110. to the controls. Note that if this is enabled, you must call <code>update()</code> in your animation
  111. loop.</p>
  112. <p>Default is <code>false</code>.</p>
  113. </div>
  114. </div>
  115. <div class="member">
  116. <h3 class="name" id="enablePan" translate="no">.<a href="#enablePan">enablePan</a><span class="type-signature"> : boolean</span> </h3>
  117. <div class="description">
  118. <p>Enable or disable camera panning.</p>
  119. <p>Default is <code>true</code>.</p>
  120. </div>
  121. </div>
  122. <div class="member">
  123. <h3 class="name" id="enableRotate" translate="no">.<a href="#enableRotate">enableRotate</a><span class="type-signature"> : boolean</span> </h3>
  124. <div class="description">
  125. <p>Enable or disable horizontal and vertical rotation of the camera.</p>
  126. <p>Note that it is possible to disable a single axis by setting the min and max of the
  127. <code>minPolarAngle</code> or <code>minAzimuthAngle</code> to the same value, which will cause the vertical
  128. or horizontal rotation to be fixed at that value.</p>
  129. <p>Default is <code>true</code>.</p>
  130. </div>
  131. </div>
  132. <div class="member">
  133. <h3 class="name" id="enableZoom" translate="no">.<a href="#enableZoom">enableZoom</a><span class="type-signature"> : boolean</span> </h3>
  134. <div class="description">
  135. <p>Enable or disable zooming (dollying) of the camera.</p>
  136. <p>Default is <code>true</code>.</p>
  137. </div>
  138. </div>
  139. <div class="member">
  140. <h3 class="name" id="keyPanSpeed" translate="no">.<a href="#keyPanSpeed">keyPanSpeed</a><span class="type-signature"> : number</span> </h3>
  141. <div class="description">
  142. <p>How fast to pan the camera when the keyboard is used in
  143. pixels per keypress.</p>
  144. <p>Default is <code>7</code>.</p>
  145. </div>
  146. </div>
  147. <div class="member">
  148. <h3 class="name" id="keyRotateSpeed" translate="no">.<a href="#keyRotateSpeed">keyRotateSpeed</a><span class="type-signature"> : number</span> </h3>
  149. <div class="description">
  150. <p>How fast to rotate the camera when the keyboard is used.</p>
  151. <p>Default is <code>1</code>.</p>
  152. </div>
  153. </div>
  154. <div class="member">
  155. <h3 class="name" id="keys" translate="no">.<a href="#keys">keys</a><span class="type-signature"> : Object</span> </h3>
  156. <div class="description">
  157. <p>This object contains references to the keycodes for controlling camera panning.</p>
  158. <pre><code class="language-js">controls.keys = {
  159. LEFT: 'ArrowLeft', //left arrow
  160. UP: 'ArrowUp', // up arrow
  161. RIGHT: 'ArrowRight', // right arrow
  162. BOTTOM: 'ArrowDown' // down arrow
  163. }
  164. </code></pre>
  165. </div>
  166. <dl class="details">
  167. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Controls.html#keys">Controls#keys</a></dt>
  168. </dl>
  169. </div>
  170. <div class="member">
  171. <h3 class="name" id="maxAzimuthAngle" translate="no">.<a href="#maxAzimuthAngle">maxAzimuthAngle</a><span class="type-signature"> : number</span> </h3>
  172. <div class="description">
  173. <p>How far you can orbit horizontally, upper limit. If set, the interval <code>[ min, max ]</code>
  174. must be a sub-interval of <code>[ - 2 PI, 2 PI ]</code>, with <code>( max - min &lt; 2 PI )</code>.</p>
  175. <p>Default is <code>-Infinity</code>.</p>
  176. </div>
  177. </div>
  178. <div class="member">
  179. <h3 class="name" id="maxDistance" translate="no">.<a href="#maxDistance">maxDistance</a><span class="type-signature"> : number</span> </h3>
  180. <div class="description">
  181. <p>How far you can dolly out (perspective camera only).</p>
  182. <p>Default is <code>Infinity</code>.</p>
  183. </div>
  184. </div>
  185. <div class="member">
  186. <h3 class="name" id="maxPolarAngle" translate="no">.<a href="#maxPolarAngle">maxPolarAngle</a><span class="type-signature"> : number</span> </h3>
  187. <div class="description">
  188. <p>How far you can orbit vertically, upper limit. Range is <code>[0, Math.PI]</code> radians.</p>
  189. <p>Default is <code>Math.PI</code>.</p>
  190. </div>
  191. </div>
  192. <div class="member">
  193. <h3 class="name" id="maxTargetRadius" translate="no">.<a href="#maxTargetRadius">maxTargetRadius</a><span class="type-signature"> : number</span> </h3>
  194. <div class="description">
  195. <p>How far you can move the target from the 3D <code>cursor</code>.</p>
  196. <p>Default is <code>Infinity</code>.</p>
  197. </div>
  198. </div>
  199. <div class="member">
  200. <h3 class="name" id="maxZoom" translate="no">.<a href="#maxZoom">maxZoom</a><span class="type-signature"> : number</span> </h3>
  201. <div class="description">
  202. <p>How far you can zoom out (orthographic camera only).</p>
  203. <p>Default is <code>Infinity</code>.</p>
  204. </div>
  205. </div>
  206. <div class="member">
  207. <h3 class="name" id="minAzimuthAngle" translate="no">.<a href="#minAzimuthAngle">minAzimuthAngle</a><span class="type-signature"> : number</span> </h3>
  208. <div class="description">
  209. <p>How far you can orbit horizontally, lower limit. If set, the interval <code>[ min, max ]</code>
  210. must be a sub-interval of <code>[ - 2 PI, 2 PI ]</code>, with <code>( max - min &lt; 2 PI )</code>.</p>
  211. <p>Default is <code>-Infinity</code>.</p>
  212. </div>
  213. </div>
  214. <div class="member">
  215. <h3 class="name" id="minDistance" translate="no">.<a href="#minDistance">minDistance</a><span class="type-signature"> : number</span> </h3>
  216. <div class="description">
  217. <p>How far you can dolly in (perspective camera only).</p>
  218. <p>Default is <code>0</code>.</p>
  219. </div>
  220. </div>
  221. <div class="member">
  222. <h3 class="name" id="minPolarAngle" translate="no">.<a href="#minPolarAngle">minPolarAngle</a><span class="type-signature"> : number</span> </h3>
  223. <div class="description">
  224. <p>How far you can orbit vertically, lower limit. Range is <code>[0, Math.PI]</code> radians.</p>
  225. <p>Default is <code>0</code>.</p>
  226. </div>
  227. </div>
  228. <div class="member">
  229. <h3 class="name" id="minTargetRadius" translate="no">.<a href="#minTargetRadius">minTargetRadius</a><span class="type-signature"> : number</span> </h3>
  230. <div class="description">
  231. <p>How close you can get the target to the 3D <code>cursor</code>.</p>
  232. <p>Default is <code>0</code>.</p>
  233. </div>
  234. </div>
  235. <div class="member">
  236. <h3 class="name" id="minZoom" translate="no">.<a href="#minZoom">minZoom</a><span class="type-signature"> : number</span> </h3>
  237. <div class="description">
  238. <p>How far you can zoom in (orthographic camera only).</p>
  239. <p>Default is <code>0</code>.</p>
  240. </div>
  241. </div>
  242. <div class="member">
  243. <h3 class="name" id="mouseButtons" translate="no">.<a href="#mouseButtons">mouseButtons</a><span class="type-signature"> : Object</span> </h3>
  244. <div class="description">
  245. <p>This object contains references to the mouse actions used by the controls.</p>
  246. <pre><code class="language-js">controls.mouseButtons = {
  247. LEFT: THREE.MOUSE.ROTATE,
  248. MIDDLE: THREE.MOUSE.DOLLY,
  249. RIGHT: THREE.MOUSE.PAN
  250. }
  251. </code></pre>
  252. </div>
  253. <dl class="details">
  254. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Controls.html#mouseButtons">Controls#mouseButtons</a></dt>
  255. </dl>
  256. </div>
  257. <div class="member">
  258. <h3 class="name" id="panSpeed" translate="no">.<a href="#panSpeed">panSpeed</a><span class="type-signature"> : number</span> </h3>
  259. <div class="description">
  260. <p>Speed of panning.</p>
  261. <p>Default is <code>1</code>.</p>
  262. </div>
  263. </div>
  264. <div class="member">
  265. <h3 class="name" id="position0" translate="no">.<a href="#position0">position0</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
  266. <div class="description">
  267. <p>Used internally by <code>saveState()</code> and <code>reset()</code>.</p>
  268. </div>
  269. </div>
  270. <div class="member">
  271. <h3 class="name" id="rotateSpeed" translate="no">.<a href="#rotateSpeed">rotateSpeed</a><span class="type-signature"> : number</span> </h3>
  272. <div class="description">
  273. <p>Speed of rotation.</p>
  274. <p>Default is <code>1</code>.</p>
  275. </div>
  276. </div>
  277. <div class="member">
  278. <h3 class="name" id="screenSpacePanning" translate="no">.<a href="#screenSpacePanning">screenSpacePanning</a><span class="type-signature"> : boolean</span> </h3>
  279. <div class="description">
  280. <p>Defines how the camera's position is translated when panning. If <code>true</code>, the camera pans
  281. in screen space. Otherwise, the camera pans in the plane orthogonal to the camera's up
  282. direction.</p>
  283. <p>Default is <code>true</code>.</p>
  284. </div>
  285. </div>
  286. <div class="member">
  287. <h3 class="name" id="target" translate="no">.<a href="#target">target</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
  288. <div class="description">
  289. <p>The focus point of the controls, the <code>object</code> orbits around this.
  290. It can be updated manually at any point to change the focus of the controls.</p>
  291. </div>
  292. </div>
  293. <div class="member">
  294. <h3 class="name" id="target0" translate="no">.<a href="#target0">target0</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
  295. <div class="description">
  296. <p>Used internally by <code>saveState()</code> and <code>reset()</code>.</p>
  297. </div>
  298. </div>
  299. <div class="member">
  300. <h3 class="name" id="touches" translate="no">.<a href="#touches">touches</a><span class="type-signature"> : Object</span> </h3>
  301. <div class="description">
  302. <p>This object contains references to the touch actions used by the controls.</p>
  303. <pre><code class="language-js">controls.mouseButtons = {
  304. ONE: THREE.TOUCH.ROTATE,
  305. TWO: THREE.TOUCH.DOLLY_PAN
  306. }
  307. </code></pre>
  308. </div>
  309. <dl class="details">
  310. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Controls.html#touches">Controls#touches</a></dt>
  311. </dl>
  312. </div>
  313. <div class="member">
  314. <h3 class="name" id="zoom0" translate="no">.<a href="#zoom0">zoom0</a><span class="type-signature"> : number</span> </h3>
  315. <div class="description">
  316. <p>Used internally by <code>saveState()</code> and <code>reset()</code>.</p>
  317. </div>
  318. </div>
  319. <div class="member">
  320. <h3 class="name" id="zoomSpeed" translate="no">.<a href="#zoomSpeed">zoomSpeed</a><span class="type-signature"> : number</span> </h3>
  321. <div class="description">
  322. <p>Speed of zooming / dollying.</p>
  323. <p>Default is <code>1</code>.</p>
  324. </div>
  325. </div>
  326. <div class="member">
  327. <h3 class="name" id="zoomToCursor" translate="no">.<a href="#zoomToCursor">zoomToCursor</a><span class="type-signature"> : boolean</span> </h3>
  328. <div class="description">
  329. <p>Setting this property to <code>true</code> allows to zoom to the cursor's position.</p>
  330. <p>Default is <code>false</code>.</p>
  331. </div>
  332. </div>
  333. <h2 class="subsection-title">Methods</h2>
  334. <h3 class="name name-method" id="dollyIn" translate="no">.<a href="#dollyIn">dollyIn</a><span class="signature">( dollyScale : <span class="param-type">number</span> )</span> </h3>
  335. <div class="method">
  336. <div class="description">
  337. <p>Programmatically dolly in (zoom in for perspective camera).</p>
  338. </div>
  339. <table class="params">
  340. <tbody>
  341. <tr>
  342. <td class="name">
  343. <strong translate="no">dollyScale</strong>
  344. </td>
  345. <td class="description last">
  346. <p>The dolly scale factor.</p>
  347. </td>
  348. </tr>
  349. </tbody>
  350. </table>
  351. </div>
  352. <h3 class="name name-method" id="dollyOut" translate="no">.<a href="#dollyOut">dollyOut</a><span class="signature">( dollyScale : <span class="param-type">number</span> )</span> </h3>
  353. <div class="method">
  354. <div class="description">
  355. <p>Programmatically dolly out (zoom out for perspective camera).</p>
  356. </div>
  357. <table class="params">
  358. <tbody>
  359. <tr>
  360. <td class="name">
  361. <strong translate="no">dollyScale</strong>
  362. </td>
  363. <td class="description last">
  364. <p>The dolly scale factor.</p>
  365. </td>
  366. </tr>
  367. </tbody>
  368. </table>
  369. </div>
  370. <h3 class="name name-method" id="getAzimuthalAngle" translate="no">.<a href="#getAzimuthalAngle">getAzimuthalAngle</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  371. <div class="method">
  372. <div class="description">
  373. <p>Get the current horizontal rotation, in radians.</p>
  374. </div>
  375. <dl class="details">
  376. <dt class="tag-returns"><strong>Returns:</strong> The current horizontal rotation, in radians.</dt>
  377. </dl>
  378. </div>
  379. <h3 class="name name-method" id="getDistance" translate="no">.<a href="#getDistance">getDistance</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  380. <div class="method">
  381. <div class="description">
  382. <p>Returns the distance from the camera to the target.</p>
  383. </div>
  384. <dl class="details">
  385. <dt class="tag-returns"><strong>Returns:</strong> The distance from the camera to the target.</dt>
  386. </dl>
  387. </div>
  388. <h3 class="name name-method" id="getPolarAngle" translate="no">.<a href="#getPolarAngle">getPolarAngle</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  389. <div class="method">
  390. <div class="description">
  391. <p>Get the current vertical rotation, in radians.</p>
  392. </div>
  393. <dl class="details">
  394. <dt class="tag-returns"><strong>Returns:</strong> The current vertical rotation, in radians.</dt>
  395. </dl>
  396. </div>
  397. <h3 class="name name-method" id="listenToKeyEvents" translate="no">.<a href="#listenToKeyEvents">listenToKeyEvents</a><span class="signature">( domElement : <span class="param-type">HTMLElement</span> )</span> </h3>
  398. <div class="method">
  399. <div class="description">
  400. <p>Adds key event listeners to the given DOM element.
  401. <code>window</code> is a recommended argument for using this method.</p>
  402. </div>
  403. <table class="params">
  404. <tbody>
  405. <tr>
  406. <td class="name">
  407. <strong translate="no">domElement</strong>
  408. </td>
  409. <td class="description last">
  410. <p>The DOM element</p>
  411. </td>
  412. </tr>
  413. </tbody>
  414. </table>
  415. </div>
  416. <h3 class="name name-method" id="pan" translate="no">.<a href="#pan">pan</a><span class="signature">( deltaX : <span class="param-type">number</span>, deltaY : <span class="param-type">number</span> )</span> </h3>
  417. <div class="method">
  418. <div class="description">
  419. <p>Programmatically pan the camera.</p>
  420. </div>
  421. <table class="params">
  422. <tbody>
  423. <tr>
  424. <td class="name">
  425. <strong translate="no">deltaX</strong>
  426. </td>
  427. <td class="description last">
  428. <p>The horizontal pan amount in pixels.</p>
  429. </td>
  430. </tr>
  431. <tr>
  432. <td class="name">
  433. <strong translate="no">deltaY</strong>
  434. </td>
  435. <td class="description last">
  436. <p>The vertical pan amount in pixels.</p>
  437. </td>
  438. </tr>
  439. </tbody>
  440. </table>
  441. </div>
  442. <h3 class="name name-method" id="reset" translate="no">.<a href="#reset">reset</a><span class="signature">()</span> </h3>
  443. <div class="method">
  444. <div class="description">
  445. <p>Reset the controls to their state from either the last time the <code>saveState()</code>
  446. was called, or the initial state.</p>
  447. </div>
  448. </div>
  449. <h3 class="name name-method" id="rotateLeft" translate="no">.<a href="#rotateLeft">rotateLeft</a><span class="signature">( angle : <span class="param-type">number</span> )</span> </h3>
  450. <div class="method">
  451. <div class="description">
  452. <p>Programmatically rotate the camera left (around the vertical axis).</p>
  453. </div>
  454. <table class="params">
  455. <tbody>
  456. <tr>
  457. <td class="name">
  458. <strong translate="no">angle</strong>
  459. </td>
  460. <td class="description last">
  461. <p>The rotation angle in radians.</p>
  462. </td>
  463. </tr>
  464. </tbody>
  465. </table>
  466. </div>
  467. <h3 class="name name-method" id="rotateUp" translate="no">.<a href="#rotateUp">rotateUp</a><span class="signature">( angle : <span class="param-type">number</span> )</span> </h3>
  468. <div class="method">
  469. <div class="description">
  470. <p>Programmatically rotate the camera up (around the horizontal axis).</p>
  471. </div>
  472. <table class="params">
  473. <tbody>
  474. <tr>
  475. <td class="name">
  476. <strong translate="no">angle</strong>
  477. </td>
  478. <td class="description last">
  479. <p>The rotation angle in radians.</p>
  480. </td>
  481. </tr>
  482. </tbody>
  483. </table>
  484. </div>
  485. <h3 class="name name-method" id="saveState" translate="no">.<a href="#saveState">saveState</a><span class="signature">()</span> </h3>
  486. <div class="method">
  487. <div class="description">
  488. <p>Save the current state of the controls. This can later be recovered with <code>reset()</code>.</p>
  489. </div>
  490. </div>
  491. <h3 class="name name-method" id="stopListenToKeyEvents" translate="no">.<a href="#stopListenToKeyEvents">stopListenToKeyEvents</a><span class="signature">()</span> </h3>
  492. <div class="method">
  493. <div class="description">
  494. <p>Removes the key event listener previously defined with <code>listenToKeyEvents()</code>.</p>
  495. </div>
  496. </div>
  497. <h2 class="subsection-title">Events</h2>
  498. <h3 class="name name-method" id="event:change" translate="no">.<a href="#event:change">change</a> </h3>
  499. <div class="method">
  500. <div class="description">
  501. <p>Fires when the camera has been transformed by the controls.</p>
  502. </div>
  503. <h5>Type:</h5>
  504. <ul>
  505. <li>
  506. <span class="param-type">Object</span>
  507. </li>
  508. </ul>
  509. </div>
  510. <h3 class="name name-method" id="event:end" translate="no">.<a href="#event:end">end</a> </h3>
  511. <div class="method">
  512. <div class="description">
  513. <p>Fires when an interaction has finished.</p>
  514. </div>
  515. <h5>Type:</h5>
  516. <ul>
  517. <li>
  518. <span class="param-type">Object</span>
  519. </li>
  520. </ul>
  521. </div>
  522. <h3 class="name name-method" id="event:start" translate="no">.<a href="#event:start">start</a> </h3>
  523. <div class="method">
  524. <div class="description">
  525. <p>Fires when an interaction was initiated.</p>
  526. </div>
  527. <h5>Type:</h5>
  528. <ul>
  529. <li>
  530. <span class="param-type">Object</span>
  531. </li>
  532. </ul>
  533. </div>
  534. <h2 class="subsection-title">Source</h2>
  535. <p>
  536. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/OrbitControls.js" translate="no" target="_blank" rel="noopener">examples/jsm/controls/OrbitControls.js</a>
  537. </p>
  538. </article>
  539. </section>
  540. <script src="../scripts/linenumber.js"></script>
  541. <script src="../scripts/page.js"></script>
  542. </body>
  543. </html>
粤ICP备19079148号