Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

CameraTrait

const CameraTrait: Trait<{ bodyNearEye: () => BodyNearEye; characterFade: number; characterHidden: boolean; clickToWalk: boolean; eyeHeightFraction: number; fieldOfView: () => CameraFieldOfView | null; firstPerson: boolean; firstPersonMaxPolarAngle: number; firstPersonMinPolarAngle: number; firstPersonView: boolean; follow: () => ViewTarget | null; followed: () => Entity | null; followedTeleports: number; fov: number; hiddenParts: () => Set<Object3D<Object3DEventMap>>; holdSeconds: number; invertLook: boolean; latch: boolean; latchedHeading: number; latchedSteer: () => Vector2; latchTurn: number; locked: boolean; lockToggle: boolean; lockToggleOffered: boolean; lookSpeed: number; maxDistance: number; maxPolarAngle: number; metresPerSecond: number; minDistance: number; minPolarAngle: number; orbit: () => CameraControls | null; pivotRise: number; playerLook: boolean; rotateSpeed: number; settle: boolean; settledDistance: () => number | null; settledPivotReach: () => number | null; shoulderOffset: number; startLocked: boolean; turnRate: number; }>

The mounted orbit and what the eye settle left behind, on an entity of its own the way GroundTrait and ObstaclesTrait hold theirs. Camera spawns it and destroys it, so the loop, the save and her steering read the camera out of the world rather than being handed it, and a world that never mounted one simply has no match.