Ground Marker Arrows
Manages 3D floating arrow indicators that appear at intersections along a navigation route, guiding the player through turns. Uses a pooled TSStatic approach with smooth fade/scale transitions.
Manages 3D floating arrow indicators that appear at intersections along a navigation route, guiding the player through turns. Uses a pooled TSStatic approach with smooth fade/scale transitions.
Public API
| Function | Signature | Description |
|---|---|---|
M.createArrowPool | (floatingArrowColor) | Creates or resets a pool of 11 TSStatic arrow objects in a SimGroup named arrowPool. |
M.updateArrows | (path, pathLength) | Analyzes the route path, placing arrows at intersections with >25° turns or ambiguous directions. Max 180 m ahead. Also tracks wrong-direction driving. |
M.clearArrows | () | Deletes all arrow objects and clears tracking tables. |
M.onPreRender | (dt) | Per-frame: smoothly updates arrow position, scale, and alpha based on proxy state. |
M.onExit | () | Alias for clearArrows. |
Arrow Proxy System
Each arrow has a proxy table tracking:
| Field | Type | Description |
|---|---|---|
pos | vec3 | World position (includes 3.5 m height offset). |
rot | quat | Rotation pointing toward next waypoint. |
state | string | "unused", "visible", or "fadeout". |
wp | string | Associated waypoint ID. |
nudgeForwardSmoother | smoother | Animates forward nudge for close arrows. |
nearFarScaleSmoother | smoother | Scales between small (3) and large (4.5) based on distance. |
alphaSmoother | smoother | Fade in/out animation. |
Arrow Placement Logic
- Walk the route path from index 2 onward.
- At each node with >2 links (intersection), compute the angle between previous and next segments.
- Place an arrow if the angle exceeds 25° or if the route direction isn't the smallest-angle option.
- Skip nodes beyond 180 m from the vehicle.
Wrong Direction Detection
- Tracks
wrongDirectionCounterbased on velocity dot product with route direction. - Shows "Please make a U-turn" message when counter exceeds threshold.
Usage Example
-- Typically called by core_groundMarkers, not directly:
core_groundMarkerArrows.createArrowPool({0, 0.48, 0.77})
core_groundMarkerArrows.updateArrows(routePath, totalDistance)
-- Cleanup
core_groundMarkerArrows.clearArrows()Game State
Manages the high-level game state (freeroam, campaign, etc.), loading screen lifecycle, and main menu visibility. Coordinates between Lua systems and the UI layer during level transitions.
Ground Markers
Renders navigation ground-decal arrows and floating 3D arrows along a computed route path. The primary navigation display system used by freeroam GPS and missions.