ThirdPersonRig
Since 0.6
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
| Member | Signature | Description |
|---|---|---|
kind | readonly kind = "third-person" as const | |
config | readonly config: ThirdPersonConfig | |
yaw | yaw: number | |
pitch | pitch: number | |
desiredDistance | desiredDistance: number | Resting arm length, moved by zoom; the collision cast shortens the current arm, not this. |
armLength | armLength: number | Current arm length after collision and smoothing. |
pose | pose: CameraPose | |
obstructed | obstructed = false | Set on the tick the arm was shortened by geometry; useful to tests and to the critic. |
constructor | constructor(config: Partial<ThirdPersonConfig> = {}) | |
followTarget | followTarget(ctx: Ctx): EntityHandle | null | |
update | update(ctx: Ctx, dt: number, input: RigInput): CameraPose | |
engineParams | engineParams(): 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. |
setHeading | setHeading(yaw: number, pitch: number): void | Point the arm along a world direction (used when a transition hands over an existing heading). |
pivotPoint | get pivotPoint(): Vec3 | The pivot the arm currently hangs from; the eye is always distance back along the view ray from it. |
restingDistance | get restingDistance(): number | Distance from the eye to the pivot if nothing were in the way. |
leadOffset | get leadOffset(): Vec3 | The look-ahead offset currently added to the pivot, cut short by a wall ahead; zero unless lookAhead is set. |
shortenedBy | get shortenedBy(): number | How far the arm was shortened by geometry this tick. |