Skip to main content

CameraOptions

@zylem/game-lib


@zylem/game-lib / core / CameraOptions

Interface: CameraOptions

Defined in: packages/game-lib/src/lib/camera/camera.ts:11

Properties​

behaviors?​

optional behaviors?: Record<string, CameraBehavior>

Defined in: packages/game-lib/src/lib/camera/camera.ts:37

Initial behaviors to attach to the camera pipeline. Keys are used for idempotent add/remove.


damping?​

optional damping?: number

Defined in: packages/game-lib/src/lib/camera/camera.ts:43

Pipeline smoothing factor (0-1). 1 = instant snap, 0 = no movement.

Default​

0.15

name?​

optional name?: string

Defined in: packages/game-lib/src/lib/camera/camera.ts:32

Optional name for camera manager lookup.


perspective?​

optional perspective?: PerspectiveType

Defined in: packages/game-lib/src/lib/camera/camera.ts:12


position?​

optional position?: Vec3Input

Defined in: packages/game-lib/src/lib/camera/camera.ts:13


renderToTexture?​

optional renderToTexture?: object

Defined in: packages/game-lib/src/lib/camera/camera.ts:51

When set, the camera renders to an offscreen texture instead of a screen viewport. Use with setCameraFeed() to display the feed on an in-scene mesh (jumbotron, security monitor, portal, etc.).

height?​

optional height?: number

Texture height in pixels.

Default​
512

width?​

optional width?: number

Texture width in pixels.

Default​
512

Default​

undefined (renders to screen)

screenResolution?​

optional screenResolution?: Vec2Input

Defined in: packages/game-lib/src/lib/camera/camera.ts:16


skipDebugOrbit?​

optional skipDebugOrbit?: boolean

Defined in: packages/game-lib/src/lib/camera/camera.ts:64

When true, this camera will not activate orbital controls in debug mode. The pipeline (and its behaviors) will always run for this camera. Use for cameras with custom behaviors (e.g. FPS mouse-look) that must control the camera through the pipeline rather than debug orbit controls.

Default​

false

target?​

optional target?: Vec3Input

Defined in: packages/game-lib/src/lib/camera/camera.ts:14


useOrbitalControls?​

optional useOrbitalControls?: boolean

Defined in: packages/game-lib/src/lib/camera/camera.ts:22

Enable orbital controls for this camera. Can be toggled at runtime via enableOrbitalControls() / disableOrbitalControls().

Default​

false

viewport?​

optional viewport?: Viewport

Defined in: packages/game-lib/src/lib/camera/camera.ts:28

Viewport in normalized coordinates (0-1). Defines where this camera renders on the canvas.

Default​

{ x: 0, y: 0, width: 1, height: 1 } (fullscreen)

zoom?​

optional zoom?: number

Defined in: packages/game-lib/src/lib/camera/camera.ts:15