# CameraComponent

> Talos next · Since 0.6; changed in next

## Signature

```ts
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
  /** Orthographic: `[width, height]` of the reference view the box is measured in; absent, 1920 x 1080. */
  referenceResolution?: [number, number]
  /** Orthographic: draw at `referenceResolution`, scaled up by a whole number with nearest filtering and letterbox bars. */
  pixelPerfect?: 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), "viewport" (into `viewport`) or "texture" (into a texture materials name as `"camera:<entity id>"`). */
  output?: "screen" | "overlay" | "viewport" | "texture"
  /** A thermal look over this camera's view (`output: "viewport"` only): hot-tagged entities bright (or dark), the rest from the scene's brightness. */
  sensor?: { mode?: "thermal-white" | "thermal-black"; hotTags: string[]; warmTags?: string[]; sceneHeat?: number; contrast?: number; noise?: number; ambient?: number }
  /** [x, y, width, height] as 0..1 fractions of the window; for `output: "viewport"` only. */
  viewport?: [number, number, number, number]
  /** For `output: "texture"` only: the picture's size in pixels, pictures a second, mirrored, and how near the screen camera must be. */
  texture?: { size: [number, number]; refreshHz?: number; mirror?: boolean; near?: 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. |
| `referenceResolution` | `referenceResolution?: [number, number]` | Orthographic: `[width, height]` of the reference view the box is measured in; absent, 1920 x 1080. |
| `pixelPerfect` | `pixelPerfect?: boolean` | Orthographic: draw at `referenceResolution`, scaled up by a whole number with nearest filtering and letterbox bars. |
| `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" \| "texture"` | "screen" (default), "overlay" (over the screen view, depth cleared), "viewport" (into `viewport`) or "texture" (into a texture materials name as `"camera:<entity id>"`). |
| `sensor` | `sensor?: { mode?: "thermal-white" \| "thermal-black"; hotTags: string[]; warmTags?: string[]; sceneHeat?: number; contrast?: number; noise?: number; ambient?: number }` | A thermal look over this camera's view (`output: "viewport"` only): hot-tagged entities bright (or dark), the rest from the scene's brightness. |
| `viewport` | `viewport?: [number, number, number, number]` | [x, y, width, height] as 0..1 fractions of the window; for `output: "viewport"` only. |
| `texture` | `texture?: { size: [number, number]; refreshHz?: number; mirror?: boolean; near?: number }` | For `output: "texture"` only: the picture's size in pixels, pictures a second, mirrored, and how near the screen camera must be. |
| `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. |
