Skip to content

five-on-it / apps/client/src/renderer/camera / CameraFollower

Class: CameraFollower ​

Defined in: apps/client/src/renderer/camera.ts:278

Smoothly follows a desired pose: quick on the ground plane, slow on height. Given the velocity of what it follows, it moves with it first and eases only the difference, so at a steady speed it trails the car by nothing (an eighth of a second's travel before, 2.8 m at 80 km/h) and when the car stops in a blow the picture stops with it, instead of closing that trail over the next third of a second.

Constructors ​

Constructor ​

new CameraFollower(initial): CameraFollower

Defined in: apps/client/src/renderer/camera.ts:282

Parameters ​

initial ​

CameraPose

Returns ​

CameraFollower

Properties ​

pose ​

pose: CameraPose

Defined in: apps/client/src/renderer/camera.ts:280

The pose to render this frame.

Accessors ​

height ​

Get Signature ​

get height(): number

Defined in: apps/client/src/renderer/camera.ts:287

The camera's height over the point it looks at (m).

Returns ​

number

Methods ​

update() ​

update(desired, dt, velocity?): void

Defined in: apps/client/src/renderer/camera.ts:292

Moves toward desired by dt seconds, carried along by velocity (m/s, the desired pose's own motion) first when given.

Parameters ​

desired ​

CameraPose

dt ​

number

velocity? ​

Vec3

Returns ​

void