Overview
Gitlantis provides two navigation aids to help you orient yourself in the 3D ocean world: an overhead minimap and a directional compass.Minimap
The minimap renders a top-down orthographic view of the world, centered on your boat.Minimap Modes
- Standard Mode
- Fullscreen Mode
In standard mode, the minimap appears as a small overlay in the bottom-right corner:Source:
- Size: 120x120 pixels
- Position: 10px from bottom-right corner
- Zoom level: 3.5x
- Toggle: Press
Fto switch to fullscreen
src/browser/hooks/useMinimap/index.ts:18-30Camera Implementation
The minimap uses a virtual orthographic camera that tracks the boat from above:src/browser/hooks/useMinimap/index.ts:36-39
Rendering Pipeline
The minimap uses WebGL scissor testing to render a separate viewport:src/browser/hooks/useMinimap/index.ts:42-61
Interactive Minimap
You can click on the minimap to open files and folders:Click Detection Logic
Click Detection Logic
- Checks if the click is within minimap bounds
- Converts screen coordinates to normalized device coordinates
- Uses raycasting to detect which object was clicked
- Calls the object’s
openOnClickhandler
src/browser/hooks/useMinimap/index.ts:84-104Visibility Settings
The minimap respects user settings and can be hidden:src/browser/hooks/useMinimap/index.ts:33
Compass
The compass displays your current heading using cardinal directions and degrees.Heading Calculation
The compass extracts the boat’s yaw rotation and converts it to degrees:src/browser/hooks/useBoat/compass/index.ts:12-18
Cardinal Directions
The compass supports 8 cardinal directions:- Cardinal Points
- Closest Cardinal
src/browser/hooks/useBoat/compass/index.ts:24-33Scrollable Compass Strip
The compass creates a scrollable strip of cardinal points:src/browser/hooks/useBoat/compass/index.ts:56-69
Display Format
The compass displays both numeric degrees and the nearest cardinal direction:Example:
347° NW or 90° ESource: src/browser/hooks/useBoat/compass/index.ts:75-77Performance Considerations
Both navigation aids are designed for minimal performance impact:- Minimap: Uses scissor testing to avoid separate render passes
- Compass: Updates at 60fps but only recalculates when rotation changes
- Fade-in: Both components respect the splash screen state and fade in after 1700ms
src/browser/components/world/minimap/index.tsx:12-20