Skip to main content

FirstPersonOptions

@zylem/game-lib


@zylem/game-lib / core / FirstPersonOptions

Interface: FirstPersonOptions

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

Configuration for the first-person perspective.

Properties​

defaultFov?​

optional defaultFov?: number

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

Default field of view in degrees.

Default​

75

eyeHeight?​

optional eyeHeight?: number

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

Vertical offset above the target entity's position (eye height).

Default​

1.7

fovLerpSpeed?​

optional fovLerpSpeed?: number

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

Lerp speed for FOV zoom transitions.

Default​

8

initialLookAt?​

optional initialLookAt?: Vec3Input

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

Fallback look-at point used to derive initial yaw/pitch when no target.


initialPosition?​

optional initialPosition?: Vec3Input

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

Fallback position when no target entity is attached.


lookAtLerpSpeed?​

optional lookAtLerpSpeed?: number

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

Lerp speed for smooth look-at transitions.

Default​

5

pitchLimit?​

optional pitchLimit?: number

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

Maximum pitch angle in radians.

Default​

Math.PI/2 - 0.01

targetKey?​

optional targetKey?: string

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

Key in CameraContext.targets to follow.

Default​

'primary'

verticalSmoothing?​

optional verticalSmoothing?: number

Defined in: packages/game-lib/src/lib/camera/perspectives/first-person-perspective.ts:33

Vertical (eye-height) smoothing factor in 0..1, applied per 60Hz frame. 1 = instant snap (no smoothing), lower = smoother. Hides physics micro-jitter and Rapier sub-step Y corrections without adding perceptible input lag. Smooths only Y; X/Z still snap to the target every frame so horizontal aim is never laggy.

Default​

1 (disabled)