Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / CameraComponent

Class: CameraComponent ​

Defined in: components/Camera.ts:164

Camera entity state. Supports perspective and orthographic projections, a 3d or ar runtime type, and an isDefault flag for the camera that the preview/editor renders through. Field-of-view, near/far, ortho frustum, and zoom are persisted; the live THREE.Camera is recreated when the project loads.

Extends ​

Constructors ​

Constructor ​

ts
new CameraComponent(payload?): CameraComponent;

Defined in: components/Camera.ts:190

Parameters ​

ParameterType
payloadCameraComponentOptions

Returns ​

CameraComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDescriptionDefined in
cameraCameraLive three.js camera. Recreated when the project loads to match projection.components/Camera.ts:166
typeCameraRuntimeTypeRuntime camera mode (3d or ar).components/Camera.ts:168
isDefaultbooleanWhen true, this is the active rendering camera. Only one camera per scene should be the default.components/Camera.ts:170
projectionCameraProjectionActive projection model (perspective or orthographic).components/Camera.ts:172
fovnumberVertical field of view in degrees. Used when projection is perspective.components/Camera.ts:174
nearnumberNear clip plane in world units.components/Camera.ts:176
farnumberFar clip plane in world units.components/Camera.ts:178
leftnumberLeft edge of the orthographic frustum (orthographic only).components/Camera.ts:180
rightnumberRight edge of the orthographic frustum (orthographic only).components/Camera.ts:182
topnumberTop edge of the orthographic frustum (orthographic only).components/Camera.ts:184
bottomnumberBottom edge of the orthographic frustum (orthographic only).components/Camera.ts:186
zoomnumberZoom multiplier applied to the projection.components/Camera.ts:188