Skip to main content

TopDownPerspective

@zylem/game-lib


@zylem/game-lib / core / TopDownPerspective

Class: TopDownPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/top-down-perspective.ts:40

Orthographic top-down perspective.

Rotation is locked to world -Y. The camera follows the target's XZ and stays height above it. Player look input is not accepted.

Implements​

Constructors​

Constructor​

new TopDownPerspective(options?): TopDownPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/top-down-perspective.ts:49

Parameters​

options?​

TopDownOptions

Returns​

TopDownPerspective

Properties​

defaults​

readonly defaults: object

Defined in: packages/game-lib/src/lib/camera/perspectives/top-down-perspective.ts:43

Optional defaults for smoothing and other pipeline settings.

damping​

damping: number = 1

Implementation of​

CameraPerspective.defaults


id​

readonly id: "top-down" = 'top-down'

Defined in: packages/game-lib/src/lib/camera/perspectives/top-down-perspective.ts:41

Implementation of​

CameraPerspective.id


projection​

readonly projection: "orthographic"

Defined in: packages/game-lib/src/lib/camera/perspectives/top-down-perspective.ts:42

Projection the Three.js camera must use. When omitted, the runtime keeps a perspective camera. Orthographic perspectives set this so a runtime switch replaces the camera instance.

Implementation of​

CameraPerspective.projection

Methods​

getBasePose()​

getBasePose(ctx): CameraPose

Defined in: packages/game-lib/src/lib/camera/perspectives/top-down-perspective.ts:56

Compute the raw desired pose for this frame given the current context.

Parameters​

ctx​

CameraContext

Returns​

CameraPose

Implementation of​

CameraPerspective.getBasePose