hex-world
    Preparing search index...

    Function cameraGroundFootprint

    • Returns the four ground-plane points the camera's view frustum covers, in screen order: top-left, top-right, bottom-right, bottom-left.

      This is the shape to outline on a minimap to show "what you are looking at". Corners that would land past maxDistance (or above the horizon) are clamped along their own ray, so the polygon stays well-formed at shallow pitches rather than vanishing.

      Returns null when the camera is at or below the ground plane, where a footprint is meaningless.

      Parameters

      Returns Vector3[] | null

      const quad = cameraGroundFootprint(world.camera);
      if (quad) for (const p of quad) transform.worldToImage(p.x, p.z);