CameraAPI
Defined in: packages/threeplay/src/plugins/camera/types.ts:123
API of the camera plugin. Works on k.camera3d; resets on scene change.
Methods
Section titled “Methods”camFollow()
Section titled “camFollow()”camFollow(
target,opts?):CameraController
Defined in: packages/threeplay/src/plugins/camera/types.ts:141
Chase camera with an offset.
Parameters
Section titled “Parameters”target
Section titled “target”Returns
Section titled “Returns”camForward()
Section titled “camForward()”camForward():
Vector3
Defined in: packages/threeplay/src/plugins/camera/types.ts:132
Horizontal forward direction of the camera (XZ plane, unit).
Returns
Section titled “Returns”Vector3
camFov()
Section titled “camFov()”camFov(
deg?):number
Defined in: packages/threeplay/src/plugins/camera/types.ts:130
Gets or sets the vertical field of view in degrees.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number
camLookAt()
Section titled “camLookAt()”camLookAt(
target):void
Defined in: packages/threeplay/src/plugins/camera/types.ts:128
Points the camera at a point or object. A running controller overrides it next frame.
Parameters
Section titled “Parameters”target
Section titled “target”Returns
Section titled “Returns”void
camPos()
Section titled “camPos()”Call Signature
Section titled “Call Signature”camPos():
Vector3
Defined in: packages/threeplay/src/plugins/camera/types.ts:125
Gets, or sets, the camera position (always returns a copy).
Returns
Section titled “Returns”Vector3
Call Signature
Section titled “Call Signature”camPos(
x,y?,z?):Vector3
Defined in: packages/threeplay/src/plugins/camera/types.ts:126
Parameters
Section titled “Parameters”number | Vec3Like
number
number
Returns
Section titled “Returns”Vector3
camRight()
Section titled “camRight()”camRight():
Vector3
Defined in: packages/threeplay/src/plugins/camera/types.ts:134
Horizontal right direction of the camera (XZ plane, unit).
Returns
Section titled “Returns”Vector3
camShake()
Section titled “camShake()”camShake(
intensity?,duration?):void
Defined in: packages/threeplay/src/plugins/camera/types.ts:139
Shakes the camera: a random offset decaying to zero over duration
seconds, applied after the controller and removed on the next frame.
Parameters
Section titled “Parameters”intensity?
Section titled “intensity?”number
duration?
Section titled “duration?”number
Returns
Section titled “Returns”void
firstPerson()
Section titled “firstPerson()”firstPerson(
target,opts?):FirstPersonController
Defined in: packages/threeplay/src/plugins/camera/types.ts:143
Mouse-look from the target’s eyes. Rotates the target’s yaw.
Parameters
Section titled “Parameters”target
Section titled “target”Returns
Section titled “Returns”getCameraController()
Section titled “getCameraController()”getCameraController():
CameraController|null
Defined in: packages/threeplay/src/plugins/camera/types.ts:151
The active controller, if any.
Returns
Section titled “Returns”CameraController | null
orbitCamera()
Section titled “orbitCamera()”orbitCamera(
opts?):OrbitController
Defined in: packages/threeplay/src/plugins/camera/types.ts:147
Orbit around a point (inspectors, menus, sandboxes).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”thirdPerson()
Section titled “thirdPerson()”thirdPerson(
target,opts?):ThirdPersonController
Defined in: packages/threeplay/src/plugins/camera/types.ts:145
Mouse-orbit around the target.
Parameters
Section titled “Parameters”target
Section titled “target”Returns
Section titled “Returns”topDown()
Section titled “topDown()”topDown(
target,opts?):CameraController
Defined in: packages/threeplay/src/plugins/camera/types.ts:149
Looks down at the target from above.