useCamera
useCamera(
__namedParameters?):object
Defined in: packages/engine/src/components/Camera.tsx:30
The rig the camera hangs on: it registers the mounted orbit with what it follows, so the loop aims it, and hands back the props drei’s controls take, the engine’s bindings and bounds among them. A game with controls of its own spreads them the same way.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
CameraRigOptions |
Returns
Section titled “Returns”object
| Name | Type | Default value |
|---|---|---|
mouseButtons |
object |
- |
mouseButtons.left |
1 |
CameraControls.ACTION.ROTATE |
mouseButtons.middle |
16 |
CameraControls.ACTION.DOLLY |
mouseButtons.right |
0 |
CameraControls.ACTION.NONE |
mouseButtons.wheel |
16 |
CameraControls.ACTION.DOLLY |
ref |
Dispatch<SetStateAction<CameraControls | null>> |
setOrbit |
touches |
object |
- |
touches.one |
64 |
CameraControls.ACTION.TOUCH_ROTATE |
touches.three |
0 |
CameraControls.ACTION.NONE |
touches.two |
1024 |
CameraControls.ACTION.TOUCH_DOLLY |