Skip to main content

SecondPersonPerspective

@zylem/game-lib


@zylem/game-lib / core / SecondPersonPerspective

Class: SecondPersonPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/second-person-perspective.ts:49

Second-person perspective.

Position comes from an anchor entity. The subject, when present, is the look-at; otherwise the camera looks along the anchor's forward (−Z). The player's facing does not move this camera.

Implements​

Constructors​

Constructor​

new SecondPersonPerspective(options?): SecondPersonPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/second-person-perspective.ts:58

Parameters​

options?​

SecondPersonOptions

Returns​

SecondPersonPerspective

Properties​

defaults​

readonly defaults: object

Defined in: packages/game-lib/src/lib/camera/perspectives/second-person-perspective.ts:52

Optional defaults for smoothing and other pipeline settings.

damping​

damping: number = 1

Implementation of​

CameraPerspective.defaults


id​

readonly id: "second-person" = 'second-person'

Defined in: packages/game-lib/src/lib/camera/perspectives/second-person-perspective.ts:50

Implementation of​

CameraPerspective.id


projection​

readonly projection: "perspective"

Defined in: packages/game-lib/src/lib/camera/perspectives/second-person-perspective.ts:51

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/second-person-perspective.ts:65

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

Parameters​

ctx​

CameraContext

Returns​

CameraPose

Implementation of​

CameraPerspective.getBasePose