new OrbitControls(scene, camera, userZoomSpeed, userRotateSpeed, autoRotate, autoRotateSpeed, displayPanAndZoomFrame, lineTypePanAndZoomFrame)
Behaves like THREE.OrbitControls, but uses right-handed coordinates and z as up vector.
Parameters:
Name | Type | Description |
---|---|---|
scene |
the global scene to use |
|
camera |
the camera to use |
|
userZoomSpeed |
(optional) - the speed for zooming |
|
userRotateSpeed |
(optional) - the speed for rotating |
|
autoRotate |
(optional) - if the orbit should auto rotate |
|
autoRotateSpeed |
(optional) - the speed for auto rotating |
|
displayPanAndZoomFrame |
whether to display a frame when panning/zooming (defaults to true) |
|
lineTypePanAndZoomFrame |
line type for the frame that is displayed when panning/zooming. Only has effect when displayPanAndZoomFrame is set to true. |
Methods
rotateDown(angle)
Rotate the camera down by the given angle.
Parameters:
Name | Type | Description |
---|---|---|
angle |
(optional) - the angle to rotate by |
rotateLeft(angle)
Rotate the camera to the left by the given angle.
Parameters:
Name | Type | Description |
---|---|---|
angle |
(optional) - the angle to rotate by |
rotateRight(angle)
Rotate the camera to the right by the given angle.
Parameters:
Name | Type | Description |
---|---|---|
angle |
(optional) - the angle to rotate by |
rotateUp(angle)
Rotate the camera up by the given angle.
Parameters:
Name | Type | Description |
---|---|---|
angle |
(optional) - the angle to rotate by |
showAxes()
Display the main axes for 1 second.
update()
Update the camera to the current settings.
zoomIn(zoomScale)
Zoom in by the given scale.
Parameters:
Name | Type | Description |
---|---|---|
zoomScale |
(optional) - the scale to zoom in by |
zoomOut(zoomScale)
Zoom out by the given scale.
Parameters:
Name | Type | Description |
---|---|---|
zoomScale |
(optional) - the scale to zoom in by |
(inner) intersectViewPlane(mouseRay, planeOrigin, planeNormal)
Used to track the movement during camera movement.
Parameters:
Name | Type | Description |
---|---|---|
mouseRay |
the mouse ray to intersect with |
|
planeOrigin |
the origin of the plane |
|
planeNormal |
the normal of the plane |
Returns:
the intersection
(inner) onMouseDown(event3D)
Handle the mousedown 3D event.
Parameters:
Name | Type | Description |
---|---|---|
event3D |
the 3D event to handle |
(inner) onMouseMove(event3D)
Handle the mousemove 3D event.
Parameters:
Name | Type | Description |
---|---|---|
event3D |
the 3D event to handle |
(inner) onMouseUp(event3D)
Handle the mouseup 3D event.
Parameters:
Name | Type | Description |
---|---|---|
event3D |
the 3D event to handle |
(inner) onMouseWheel(event3D)
Handle the mousewheel 3D event.
Parameters:
Name | Type | Description |
---|---|---|
event3D |
the 3D event to handle |
(inner) onTouchDown(event3D)
Handle the touchdown 3D event.
Parameters:
Name | Type | Description |
---|---|---|
event3D |
the 3D event to handle |
(inner) onTouchMove(event3D)
Handle the touchmove 3D event.
Parameters:
Name | Type | Description |
---|---|---|
event3D |
the 3D event to handle |