CameraComponent
Since 0.6
Signature
export interface CameraComponent {
type: "camera"
kind: CameraKind
fov: number
primary?: boolean
target?: string
distance?: number
/** How far this camera sees, in metres; absent, the far plane is derived from `meta.bounds`. */
far?: number
/** "perspective" (absent) or "orthographic"; orthographic ignores `fov`. */
projection?: "perspective" | "orthographic"
/** Orthographic half-height in world units, above zero. */
orthoSize?: number
/** Orthographic: screen pixels per world unit, above zero. */
pixelsPerUnit?: number
/** Orthographic: round the camera position to the pixel grid. */
pixelSnap?: boolean
/** Screen cameras compete: highest priority is the view. Default 0. */
priority?: number
/** Draw only entities on these layers; not with `hideLayers`. */
layers?: string[]
/** Draw every layer except these; not with `layers`. */
hideLayers?: string[]
/** "screen" (default), "overlay" (over the screen view, depth cleared) or "viewport" (into `viewport`). */
output?: "screen" | "overlay" | "viewport"
/** [x, y, width, height] as 0..1 fractions of the window; for `output: "viewport"` only. */
viewport?: [number, number, number, number]
/** Draw order among overlay and viewport cameras, lowest first. Default 0. */
order?: number
/** How the view blends to this camera when it becomes the screen view; absent, a cut. */
blendIn?: CameraBlend
/** Opt-in engine-driven rig of this camera's `kind`; present, even `{}`, turns it on. */
rig?: CameraRigSettings
}
Import: import type { CameraComponent } from "@argus/gameplay"
Members
| Member | Signature | Description |
|---|---|---|
type | type: "camera" | |
kind | kind: CameraKind | |
fov | fov: number | |
primary | primary?: boolean | |
target | target?: string | |
distance | distance?: number | |
far | far?: number | How far this camera sees, in metres; absent, the far plane is derived from meta.bounds. |
projection | projection?: "perspective" | "orthographic" | "perspective" (absent) or "orthographic"; orthographic ignores fov. |
orthoSize | orthoSize?: number | Orthographic half-height in world units, above zero. |
pixelsPerUnit | pixelsPerUnit?: number | Orthographic: screen pixels per world unit, above zero. |
pixelSnap | pixelSnap?: boolean | Orthographic: round the camera position to the pixel grid. |
priority | priority?: number | Screen cameras compete: highest priority is the view. Default 0. |
layers | layers?: string[] | Draw only entities on these layers; not with hideLayers. |
hideLayers | hideLayers?: string[] | Draw every layer except these; not with layers. |
output | output?: "screen" | "overlay" | "viewport" | "screen" (default), "overlay" (over the screen view, depth cleared) or "viewport" (into viewport). |
viewport | viewport?: [number, number, number, number] | [x, y, width, height] as 0..1 fractions of the window; for output: "viewport" only. |
order | order?: number | Draw order among overlay and viewport cameras, lowest first. Default 0. |
blendIn | blendIn?: CameraBlend | How the view blends to this camera when it becomes the screen view; absent, a cut. |
rig | rig?: CameraRigSettings | Opt-in engine-driven rig of this camera's kind; present, even {}, turns it on. |