Talos docs

CameraRig

Since 0.6
Plain text

Signature

export interface CameraRig {
  readonly kind: CameraKind
  /** The pose computed by the last `update`. */
  readonly pose: CameraPose
  readonly yaw: number
  readonly pitch: number
  /** The entity this rig tracks, for `ctx.camera.follow`; null for a rig pinned to a point. */
  followTarget(ctx: Ctx): EntityHandle | null
  /** Recompute the pose for this tick. Pure except for the sphere cast a collision rig performs. */
  update(ctx: Ctx, dt: number, input: RigInput): CameraPose
  /** Adopt a heading handed over by the rig a transition is coming from. Absent on rigs that cannot turn. */
  setHeading?(yaw: number, pitch: number): void
  /**
   * True when the rig names no fov of its own and draws at the view's (the scene camera's): the
   * director sends `fov: null`, so the scene camera's number stands. Absent means false.
   */
  readonly inheritsFov?: boolean
  /** Extra `ctx.camera.set` params for the engine rig (wall handling, for a boom rig). Absent when there are none. */
  engineParams?(): Record<string, unknown>
}

Import: import type { CameraRig } from "@argus/gameplay"

Members

MemberSignatureDescription
kindreadonly kind: CameraKind
posereadonly pose: CameraPoseThe pose computed by the last update.
yawreadonly yaw: number
pitchreadonly pitch: number
followTargetfollowTarget(ctx: Ctx): EntityHandle | nullThe entity this rig tracks, for ctx.camera.follow; null for a rig pinned to a point.
updateupdate(ctx: Ctx, dt: number, input: RigInput): CameraPoseRecompute the pose for this tick. Pure except for the sphere cast a collision rig performs.
setHeadingsetHeading?(yaw: number, pitch: number): voidAdopt a heading handed over by the rig a transition is coming from. Absent on rigs that cannot turn.
inheritsFovreadonly inheritsFov?: booleanTrue when the rig names no fov of its own and draws at the view's (the scene camera's): the director sends fov: null, so the scene camera's number stands. Absent means false.
engineParamsengineParams?(): Record<string, unknown>Extra ctx.camera.set params for the engine rig (wall handling, for a boom rig). Absent when there are none.