Skip to main content

ViewmodelConfig

@zylem/game-lib


@zylem/game-lib / behavior / ViewmodelConfig

Interface: ViewmodelConfig

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/first-person.d.ts:91

Viewmodel configuration for an entity that follows the camera.

Properties​

cameraObject?​

optional cameraObject?: Object3D<Object3DEventMap>

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/first-person.d.ts:103

When set, the viewmodel group is parented to this Object3D (typically the Three.js camera) and kept at the local offset/rotation. This avoids world-space teleport jitter from physics pose sync fighting the camera.


entity​

entity: any

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/first-person.d.ts:93

The entity whose visual group should be positioned relative to the camera.


offset​

offset: Vector3

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/first-person.d.ts:95

Offset from the eye position in camera-local space (right, down, forward).


rotation?​

optional rotation?: Euler

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/first-person.d.ts:97

Additional rotation applied to the viewmodel in local space (Euler angles in radians).