Talos docs

ThirdPersonConfig

Since 0.6
Plain text

Signature

export interface ThirdPersonConfig {
  /** What the arm hangs off; null is the behavior's own entity. */
  target: CameraTarget
  /** Resting arm length in metres. */
  distance: number
  /**
   * Shortest the zoom may pull the arm in to. A wall closer than this still wins: an eye held at the minimum
   * past a wall is an eye inside the wall. The engine fades the character when a wall takes the arm that short.
   */
  minDistance: number
  /** Longest the arm may be pulled out to by zoom. */
  maxDistance: number
  /** Pivot offset from the target's origin, in metres (shoulder height by default). */
  pivotOffset: Vec3
  /** Lateral pivot offset along the camera's right, for an over-the-shoulder framing. */
  shoulderOffset: number
  /** Lowest view pitch, in degrees. Negative looks down, which puts the eye above the pivot. */
  pitchMinDeg: number
  /** Highest view pitch, in degrees. Positive looks up, which puts the eye below the pivot. */
  pitchMaxDeg: number
  /** Degrees per second at full look deflection. */
  yawSpeedDeg: number
  pitchSpeedDeg: number
  /** Metres per second at full zoom deflection. */
  zoomSpeed: number
  /** Radius of the sphere swept from the pivot to the eye. */
  collisionRadius: number
  /** How far short of a hit the eye stops. */
  collisionBuffer: number
  /** Smoothing rate for the pivot following the target; higher is tighter, 0 is rigid. */
  followLambda: number
  /** Smoothing rate for the arm returning to its resting length after an obstruction. */
  distanceLambda: number
  /** Vertical field of view in degrees. */
  fov: number
  yaw: number
  pitch: number
  /**
   * Seconds of an idle look axis before the arm swings back behind the target — behind meaning the way the
   * target entity faces. `null` (the default) never recenters.
   */
  recenterDelay: number | null
  /** Fastest the recenter swing turns, degrees per second. */
  recenterSpeedDeg: number
  /** Seconds of the target's horizontal travel the pivot leads by: 0.3 at 10 m/s is 3 m ahead. 0 is off. */
  lookAhead: number
  /** Longest the lead may be, in metres, so a teleport or a launch does not throw the view. */
  lookAheadMax: number
  /** Smoothing rate for the lead settling on a new direction; higher is snappier. */
  lookAheadLambda: number
  /** Arm length, metres, below which the engine starts fading the character. `null` keeps the engine's 1 m; 0 is off. */
  fadeStart: number | null
  /** Arm length at which the character is gone. `null` keeps the engine's 0.45 m. */
  fadeFull: number | null
  /** How quickly the engine arm grows back after a wall clears, per second. `null` keeps the engine's 5. */
  recoverRate: number | null
  /** Metres the engine shifts the pivot sideways, towards the side with room, while a wall has the arm short. `null` is off. */
  collapseShoulder: number | null
  /**
   * Let the engine swing the view gently away from a wall that is shortening the arm, once the look axis has been idle
   * a moment. Off by default: with camera-relative controls a view that turns by itself turns the player's "forward"
   * too, and a run along a wall curves off it. On, the rig takes its yaw from the engine each tick so the swing sticks.
   */
  avoidWalls: boolean
}

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

Members

MemberSignatureDescription
targettarget: CameraTargetWhat the arm hangs off; null is the behavior's own entity.
distancedistance: numberResting arm length in metres.
minDistanceminDistance: numberShortest the zoom may pull the arm in to. A wall closer than this still wins: an eye held at the minimum past a wall is an eye inside the wall. The engine fades the character when a wall takes the arm that short.
maxDistancemaxDistance: numberLongest the arm may be pulled out to by zoom.
pivotOffsetpivotOffset: Vec3Pivot offset from the target's origin, in metres (shoulder height by default).
shoulderOffsetshoulderOffset: numberLateral pivot offset along the camera's right, for an over-the-shoulder framing.
pitchMinDegpitchMinDeg: numberLowest view pitch, in degrees. Negative looks down, which puts the eye above the pivot.
pitchMaxDegpitchMaxDeg: numberHighest view pitch, in degrees. Positive looks up, which puts the eye below the pivot.
yawSpeedDegyawSpeedDeg: numberDegrees per second at full look deflection.
pitchSpeedDegpitchSpeedDeg: number
zoomSpeedzoomSpeed: numberMetres per second at full zoom deflection.
collisionRadiuscollisionRadius: numberRadius of the sphere swept from the pivot to the eye.
collisionBuffercollisionBuffer: numberHow far short of a hit the eye stops.
followLambdafollowLambda: numberSmoothing rate for the pivot following the target; higher is tighter, 0 is rigid.
distanceLambdadistanceLambda: numberSmoothing rate for the arm returning to its resting length after an obstruction.
fovfov: numberVertical field of view in degrees.
yawyaw: number
pitchpitch: number
recenterDelayrecenterDelay: number | nullSeconds of an idle look axis before the arm swings back behind the target — behind meaning the way the target entity faces. null (the default) never recenters.
recenterSpeedDegrecenterSpeedDeg: numberFastest the recenter swing turns, degrees per second.
lookAheadlookAhead: numberSeconds of the target's horizontal travel the pivot leads by: 0.3 at 10 m/s is 3 m ahead. 0 is off.
lookAheadMaxlookAheadMax: numberLongest the lead may be, in metres, so a teleport or a launch does not throw the view.
lookAheadLambdalookAheadLambda: numberSmoothing rate for the lead settling on a new direction; higher is snappier.
fadeStartfadeStart: number | nullArm length, metres, below which the engine starts fading the character. null keeps the engine's 1 m; 0 is off.
fadeFullfadeFull: number | nullArm length at which the character is gone. null keeps the engine's 0.45 m.
recoverRaterecoverRate: number | nullHow quickly the engine arm grows back after a wall clears, per second. null keeps the engine's 5.
collapseShouldercollapseShoulder: number | nullMetres the engine shifts the pivot sideways, towards the side with room, while a wall has the arm short. null is off.
avoidWallsavoidWalls: booleanLet the engine swing the view gently away from a wall that is shortening the arm, once the look axis has been idle a moment. Off by default: with camera-relative controls a view that turns by itself turns the player's "forward" too, and a run along a wall curves off it. On, the rig takes its yaw from the engine each tick so the swing sticks.