Skip to main content

ThirdPersonOptions

@zylem/game-lib


@zylem/game-lib / core / ThirdPersonOptions

Interface: ThirdPersonOptions

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:8

Configuration for the third-person perspective.

Properties​

distance?​

optional distance?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:10

Distance behind the target. Default 8.


fov?​

optional fov?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:18

Perspective field of view. Default 75.


height?​

optional height?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:12

Height above the target. Default 5.


initialLookAt?​

optional initialLookAt?: Vec3Input

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:26

Fallback lookAt point when no targets exist.


initialPosition?​

optional initialPosition?: Vec3Input

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:24

Fallback camera position when no targets exist (e.g. the user-specified initial position).


minDistance?​

optional minDistance?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:22

Minimum camera distance when multi-framing. Default 5.


paddingFactor?​

optional paddingFactor?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:20

Padding multiplier when framing multiple targets. Default 1.5.


shoulderOffset?​

optional shoulderOffset?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:14

Lateral offset from the target (shoulder cam). Default 0.


targetKey?​

optional targetKey?: string

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:16

Key in CameraContext.targets to follow. Default 'primary'.


trailBufferSize?​

optional trailBufferSize?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:40

Maximum number of samples to keep in the trailing ring buffer. Sized to cover ~1 s at 120 Hz; larger only matters if trailDelay is raised significantly. Default 120.


trailDelay?​

optional trailDelay?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:34

Seconds the camera lags behind the target's actual position. The camera samples target moves from now - trailDelay so brief, fast Y motion (jump apex / fall start) doesn't get tracked 1:1 — eliminates the shimmer-on-fall effect at high refresh rates. 0 disables the trail and restores instantaneous tracking. Default 0.1 (100 ms).