Skip to main content

CameraBehavior

@zylem/game-lib


@zylem/game-lib / core / CameraBehavior

Interface: CameraBehavior

Defined in: packages/game-lib/src/lib/camera/types.ts:76

Behaviors modify the desired pose each frame. They are keyed by name (idempotent add) and sorted by priority.

Extended by​

Properties​

enabled?​

optional enabled?: boolean

Defined in: packages/game-lib/src/lib/camera/types.ts:86

When false, the behavior is skipped during the pipeline run.


priority?​

optional priority?: number

Defined in: packages/game-lib/src/lib/camera/types.ts:84

Sort order: lower runs first. Default 0.

Methods​

onAttach()?​

optional onAttach(ctx): void

Defined in: packages/game-lib/src/lib/camera/types.ts:80

Called when the behavior is attached to the pipeline.

Parameters​

ctx​

CameraContext

Returns​

void


onDetach()?​

optional onDetach(ctx): void

Defined in: packages/game-lib/src/lib/camera/types.ts:82

Called when the behavior is removed from the pipeline.

Parameters​

ctx​

CameraContext

Returns​

void


update()​

update(ctx, pose): CameraPose

Defined in: packages/game-lib/src/lib/camera/types.ts:78

Receive current context and pose, return a modified pose.

Parameters​

ctx​

CameraContext

pose​

CameraPose

Returns​

CameraPose