CameraDirector
Since 0.6
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
| Member | Signature | Description |
|---|---|---|
pose | pose: CameraPose | The pose most recently sent to ctx.camera.set. |
constructor | constructor(init: CameraDirectorInit = {}) | |
add | add(rig: CameraRig): this | |
get | get(kind: CameraKind): CameraRig | undefined | |
has | has(kind: CameraKind): boolean | |
kind | get kind(): CameraKind | |
active | get active(): CameraRig | |
blending | get blending(): boolean | |
blendProgress | get blendProgress(): number | 0..1 through the current transition; 1 when none is running. |
yaw | get yaw(): number | |
pitch | get pitch(): number | |
switchTo | switchTo(kind: CameraKind, opts: TransitionOptions = {}): void | Make 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. |
update | update(ctx: Ctx, dt: number, input: RigInput = NO_RIG_INPUT): CameraParams | Run the active rig (and the outgoing one mid-blend), push the result to ctx.camera, return it. |