Skip to main content

Fixed2DPerspective

@zylem/game-lib


@zylem/game-lib / core / Fixed2DPerspective

Class: Fixed2DPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/fixed-2d-perspective.ts:26

Fixed 2D perspective.

Returns a static orthographic pose looking down the Z-axis. No target following -- the camera stays at the configured position.

Implements​

Constructors​

Constructor​

new Fixed2DPerspective(options?): Fixed2DPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/fixed-2d-perspective.ts:33

Parameters​

options?​

Fixed2DOptions

Returns​

Fixed2DPerspective

Properties​

defaults​

readonly defaults: object

Defined in: packages/game-lib/src/lib/camera/perspectives/fixed-2d-perspective.ts:29

Optional defaults for smoothing and other pipeline settings.

damping​

damping: number = 1

Implementation of​

CameraPerspective.defaults


id​

readonly id: "fixed-2d" = 'fixed-2d'

Defined in: packages/game-lib/src/lib/camera/perspectives/fixed-2d-perspective.ts:27

Implementation of​

CameraPerspective.id


projection​

readonly projection: "orthographic"

Defined in: packages/game-lib/src/lib/camera/perspectives/fixed-2d-perspective.ts:28

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/fixed-2d-perspective.ts:41

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

Parameters​

_ctx​

CameraContext

Returns​

CameraPose

Implementation of​

CameraPerspective.getBasePose