Talos docs

CameraDirector

Since 0.6
Plain text

Signature

export class CameraDirector {
  pose: CameraPose
  constructor(init: CameraDirectorInit = {})
  add(rig: CameraRig): this
  get(kind: CameraKind): CameraRig | undefined
  has(kind: CameraKind): boolean
  get kind(): CameraKind
  get active(): CameraRig
  get blending(): boolean
  get blendProgress(): number
  get yaw(): number
  get pitch(): number
  switchTo(kind: CameraKind, opts: TransitionOptions = {}): void
  update(ctx: Ctx, dt: number, input: RigInput = NO_RIG_INPUT): CameraParams
}

Import: import { CameraDirector } from "@argus/gameplay"

Members

MemberSignatureDescription
posepose: CameraPoseThe pose most recently sent to ctx.camera.set.
constructorconstructor(init: CameraDirectorInit = {})
addadd(rig: CameraRig): this
getget(kind: CameraKind): CameraRig | undefined
hashas(kind: CameraKind): boolean
kindget kind(): CameraKind
activeget active(): CameraRig
blendingget blending(): boolean
blendProgressget blendProgress(): number0..1 through the current transition; 1 when none is running.
yawget yaw(): number
pitchget pitch(): number
switchToswitchTo(kind: CameraKind, opts: TransitionOptions = {}): voidMake kind the active rig, blending over blend seconds. Switching to the rig that is already active is a no-op. An unknown kind throws, naming the rigs that do exist.
updateupdate(ctx: Ctx, dt: number, input: RigInput = NO_RIG_INPUT): CameraParamsRun the active rig (and the outgoing one mid-blend), push the result to ctx.camera, return it.