ThirdPersonConfig
Since 0.6
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
| Member | Signature | Description |
|---|---|---|
target | target: CameraTarget | What the arm hangs off; null is the behavior's own entity. |
distance | distance: number | Resting arm length in metres. |
minDistance | minDistance: 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. |
maxDistance | maxDistance: number | Longest the arm may be pulled out to by zoom. |
pivotOffset | pivotOffset: Vec3 | Pivot offset from the target's origin, in metres (shoulder height by default). |
shoulderOffset | shoulderOffset: number | Lateral pivot offset along the camera's right, for an over-the-shoulder framing. |
pitchMinDeg | pitchMinDeg: number | Lowest view pitch, in degrees. Negative looks down, which puts the eye above the pivot. |
pitchMaxDeg | pitchMaxDeg: number | Highest view pitch, in degrees. Positive looks up, which puts the eye below the pivot. |
yawSpeedDeg | yawSpeedDeg: number | Degrees per second at full look deflection. |
pitchSpeedDeg | pitchSpeedDeg: number | |
zoomSpeed | zoomSpeed: number | Metres per second at full zoom deflection. |
collisionRadius | collisionRadius: number | Radius of the sphere swept from the pivot to the eye. |
collisionBuffer | collisionBuffer: number | How far short of a hit the eye stops. |
followLambda | followLambda: number | Smoothing rate for the pivot following the target; higher is tighter, 0 is rigid. |
distanceLambda | distanceLambda: number | Smoothing rate for the arm returning to its resting length after an obstruction. |
fov | fov: number | Vertical field of view in degrees. |
yaw | yaw: number | |
pitch | pitch: number | |
recenterDelay | recenterDelay: number | null | 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. |
recenterSpeedDeg | recenterSpeedDeg: number | Fastest the recenter swing turns, degrees per second. |
lookAhead | lookAhead: 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. |
lookAheadMax | lookAheadMax: number | Longest the lead may be, in metres, so a teleport or a launch does not throw the view. |
lookAheadLambda | lookAheadLambda: number | Smoothing rate for the lead settling on a new direction; higher is snappier. |
fadeStart | fadeStart: number | null | Arm length, metres, below which the engine starts fading the character. null keeps the engine's 1 m; 0 is off. |
fadeFull | fadeFull: number | null | Arm length at which the character is gone. null keeps the engine's 0.45 m. |
recoverRate | recoverRate: number | null | How quickly the engine arm grows back after a wall clears, per second. null keeps the engine's 5. |
collapseShoulder | collapseShoulder: number | null | Metres the engine shifts the pivot sideways, towards the side with room, while a wall has the arm short. null is off. |
avoidWalls | avoidWalls: boolean | 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. |