OrbitControls
new OrbitControls(camera: Camera, domElement: HTMLElement)THREE equivalent: THREE.OrbitControls
Pointer-driven orbit controls. Left-drag rotates, scroll zooms, right-drag pans. Dispatches change, start, and end events.
Differs from THREE.js
update() returns a boolean indicating whether the camera moved.
Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
camera |
Camera |
The camera being controlled. |
domElement |
HTMLElement |
The element that receives pointer events. |
target |
Vector3 |
World-space point the camera orbits around. |
enabled |
boolean |
When false, all interaction is ignored. |
enableRotate |
boolean |
Whether left-drag rotation is active. |
enableZoom |
boolean |
Whether scroll-wheel zoom is active. |
enablePan |
boolean |
Whether right-drag panning is active. |
rotateSpeed |
number |
Rotation sensitivity multiplier. Default 1. |
zoomSpeed |
number |
Zoom sensitivity multiplier. Default 1. |
panSpeed |
number |
Pan sensitivity multiplier. Default 1. |
minDistance |
number |
Minimum orbital radius. Default 0. |
maxDistance |
number |
Maximum orbital radius. Default Infinity. |
minPolarAngle |
number |
Minimum polar angle in radians (0 = top). Default 0. |
maxPolarAngle |
number |
Maximum polar angle in radians (Math.PI = bottom). Default Math.PI. |
enableDamping |
boolean |
When true, movements decelerate smoothly. |
dampingFactor |
number |
Fraction of velocity lost per frame when damping is enabled. Default 0.05. |
autoRotate |
boolean |
When true, the camera orbits automatically. Default false. |
autoRotateSpeed |
number |
Auto-rotation speed in degrees per second. Default 2. |
screenSpacePanning |
boolean |
When true, panning moves in screen space. When false, panning moves in the camera’s local plane. Default true. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
update(): boolean |
Applies pending rotation, zoom, and pan then repositions the camera. Must be called each frame. Returns true when the camera moved. |
reset(): void |
Restores camera position and target to their values at construction time. |
dispose(): void |
Removes all DOM event listeners. Call when the controls are no longer needed. |