Skip to content

@modoki/engine / index / Camera

Variable: Camera

const Camera: Trait<{ clearColor: number; far: number; fov: number; near: number; orthoSize: number; overlayDistance: number; projection: string; }>

Camera — engine-level camera properties. Games add their own camera behavior traits (orbit, follow, etc.) alongside this.

projection picks the lens:

  • 'perspective' (default) — uses fov (vertical, degrees) + aspect.
  • 'orthographic' — uses orthoSize (half the visible world-height, in world units; top=+orthoSize, bottom=-orthoSize, left/right derived from the viewport aspect). Unity-style knob. Good for board/top-down games where perspective foreshortening is unwanted.

Built with Modoki.