Talos docs

ThirdPersonRig

Since 0.6
Plain text

Signature

export class ThirdPersonRig implements CameraRig {
  readonly kind = "third-person" as const
  readonly config: ThirdPersonConfig
  yaw: number
  pitch: number
  desiredDistance: number
  armLength: number
  pose: CameraPose
  obstructed = false
  constructor(config: Partial<ThirdPersonConfig> = {})
  followTarget(ctx: Ctx): EntityHandle | null
  update(ctx: Ctx, dt: number, input: RigInput): CameraPose
  engineParams(): Record<string, unknown>
  setHeading(yaw: number, pitch: number): void
  get pivotPoint(): Vec3
  get restingDistance(): number
  get leadOffset(): Vec3
  get shortenedBy(): number
}

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

Members

MemberSignatureDescription
kindreadonly kind = "third-person" as const
configreadonly config: ThirdPersonConfig
yawyaw: number
pitchpitch: number
desiredDistancedesiredDistance: numberResting arm length, moved by zoom; the collision cast shortens the current arm, not this.
armLengtharmLength: numberCurrent arm length after collision and smoothing.
posepose: CameraPose
obstructedobstructed = falseSet on the tick the arm was shortened by geometry; useful to tests and to the critic.
constructorconstructor(config: Partial<ThirdPersonConfig> = {})
followTargetfollowTarget(ctx: Ctx): EntityHandle | null
updateupdate(ctx: Ctx, dt: number, input: RigInput): CameraPose
engineParamsengineParams(): Record<string, unknown>The wall-handling settings for the engine rig, as ctx.camera.set params: only the ones this rig was given, so a rig that says nothing leaves the engine's defaults in force.
setHeadingsetHeading(yaw: number, pitch: number): voidPoint the arm along a world direction (used when a transition hands over an existing heading).
pivotPointget pivotPoint(): Vec3The pivot the arm currently hangs from; the eye is always distance back along the view ray from it.
restingDistanceget restingDistance(): numberDistance from the eye to the pivot if nothing were in the way.
leadOffsetget leadOffset(): Vec3The look-ahead offset currently added to the pivot, cut short by a wall ahead; zero unless lookAhead is set.
shortenedByget shortenedBy(): numberHow far the arm was shortened by geometry this tick.