Talos docs

CameraComponent

Since 0.6Changed in next
Plain text

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
  /** 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

MemberSignatureDescription
typetype: "camera"
kindkind: CameraKind
fovfov: number
primaryprimary?: boolean
targettarget?: string
distancedistance?: number
farfar?: numberHow far this camera sees, in metres; absent, the far plane is derived from meta.bounds.
projectionprojection?: "perspective" | "orthographic""perspective" (absent) or "orthographic"; orthographic ignores fov.
orthoSizeorthoSize?: numberOrthographic half-height in world units, above zero.
pixelsPerUnitpixelsPerUnit?: numberOrthographic: screen pixels per world unit, above zero.
pixelSnappixelSnap?: booleanOrthographic: round the camera position to the pixel grid.
referenceResolutionreferenceResolution?: [number, number]Orthographic: [width, height] of the reference view the box is measured in; absent, 1920 x 1080.
pixelPerfectpixelPerfect?: booleanOrthographic: draw at referenceResolution, scaled up by a whole number with nearest filtering and letterbox bars.
prioritypriority?: numberScreen cameras compete: highest priority is the view. Default 0.
layerslayers?: string[]Draw only entities on these layers; not with hideLayers.
hideLayershideLayers?: string[]Draw every layer except these; not with layers.
outputoutput?: "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>").
sensorsensor?: { 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.
viewportviewport?: [number, number, number, number][x, y, width, height] as 0..1 fractions of the window; for output: "viewport" only.
texturetexture?: { 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.
orderorder?: numberDraw order among overlay and viewport cameras, lowest first. Default 0.
blendInblendIn?: CameraBlendHow the view blends to this camera when it becomes the screen view; absent, a cut.
rigrig?: CameraRigSettingsOpt-in engine-driven rig of this camera's kind; present, even {}, turns it on.