Skip to main content

ThirdPersonPerspective

@zylem/game-lib


@zylem/game-lib / core / ThirdPersonPerspective

Class: ThirdPersonPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:79

Third-person 3D perspective.

  • 0 targets: returns a static pose behind the origin.
  • 1 target: camera positioned behind and above the target, looking at it.
  • 2+ targets: weighted-centroid framing with dynamic distance.

Implements​

Constructors​

Constructor​

new ThirdPersonPerspective(options?): ThirdPersonPerspective

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:96

Parameters​

options?​

ThirdPersonOptions

Returns​

ThirdPersonPerspective

Properties​

defaults​

readonly defaults: object

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:87

Slightly looser than the previous 0.15 to compose better with the trailing-delay follow: the trail absorbs short, fast moves and the damping smooths the rest.

damping​

damping: number = 0.12

Implementation of​

CameraPerspective.defaults


id​

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

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:80

Implementation of​

CameraPerspective.id


projection​

readonly projection: "perspective"

Defined in: packages/game-lib/src/lib/camera/perspectives/third-person-perspective.ts:81

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/third-person-perspective.ts:107

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

Parameters​

ctx​

CameraContext

Returns​

CameraPose

Implementation of​

CameraPerspective.getBasePose