Ring Marker - 3D Ring Checkpoint Marker
A race checkpoint marker that renders a 3D ring (hoop) at the waypoint position. Supports normal/up orientation, scales to waypoint radius, and swaps between regular and finish ring shapes based on mo
A race checkpoint marker that renders a 3D ring (hoop) at the waypoint position. Supports normal/up orientation, scales to waypoint radius, and swaps between regular and finish ring shapes based on mode.
Class API (OOP via metatable)
| Method | Signature | Description |
|---|---|---|
C:init | (id) | Initializes state: color timers, alpha tracking, ring reference |
C:update | (dt, dtSim) | Per-frame: color lerp, alpha fade in/out, ring scale |
C:setToCheckpoint | (wp) | Sets pos/radius/normal/up, applies shape and rotation |
C:setMode | (mode) | Transitions mode, swaps ring shape, triggers color blend |
C:setVisibility | (v) | Shows/hides the ring TSStatic |
C:createMarkers | () | Spawns the ring TSStatic |
C:clearMarkers | () | Deletes all spawned objects |
C:show | () | Shows the marker (sets visibility to true) |
C:createObject | (shapeName, objectName) | Creates a TSStatic object for the marker |
Mode Colors & Shapes
| Mode | Color (RGB) | Shape |
|---|---|---|
default | {1, 0.07, 0} | checkpoint_ring.dae |
next | {0, 0, 0} | checkpoint_ring.dae |
start | {0.4, 1, 0.2} | checkpoint_ring.dae |
lap | {0.4, 1, 0.2} | checkpoint_ring_finish.dae |
final | {0.1, 0.3, 1} | checkpoint_ring_finish.dae |
branch | {1, 0.6, 0} | checkpoint_ring.dae |
hidden | {0, 0, 0} | checkpoint_ring.dae |
How It Works
- Two ring shapes: Regular checkpoints use
checkpoint_ring.dae, lap/final usecheckpoint_ring_finish.dae - Orientation: Ring is rotated via
quatFromDir(fwd, up)using the waypoint'snormalandupvectors - Scale: Ring scales to
vec3(radius, radius, radius)- checkpoint radius maps directly to ring size - Color transition: Lerps between old/new mode colors and base colors over 0.3 seconds
- Alpha fade: When transitioning to/from
hidden, alpha smoothly interpolates (0→1 or 1→0) - Shape swap:
setModeandsetToCheckpointcallpreApply/postApplyto hot-swap the shape DAE
Usage Example
local createMarker = require("scenario/raceMarkers/ringMarker")
local marker = createMarker(1)
marker:createMarkers()
marker:setToCheckpoint({
pos = vec3(100, 200, 50),
radius = 8,
normal = vec3(0, 1, 0), -- direction the ring faces
up = vec3(0, 0, 1),
mode = 'default'
})
marker:setMode('default')Key Notes
- Ring mesh path:
art/shapes/interface/ringMarker/checkpoint_ring.dae - Finish ring:
art/shapes/interface/ringMarker/checkpoint_ring_finish.dae - Scale is
radius + 1.5insetToCheckpointfor visual padding - Uses
baseColorper mode for secondary tinting (white for most, black for next/hidden)
See Also
- Race Marker: Attention - Floating Arrow Checkpoint Marker - Related reference
- Race Marker: Crawl Marker - Arrow + Flag + Column Checkpoint - Related reference
- Race Marker: Cylinder - Base + Cylinder Checkpoint Marker - Related reference
- Scenario System Guide - Guide
Overhead Marker
A race checkpoint marker that displays a single floating arrow shape above the waypoint position. The arrow faces the camera, bobs up and down, and color-lerps between modes.
Side Column Marker
The most complex race marker. Renders a full gate structure with left/right pillars, cones at ground level, tall distance columns, ground-anchoring cylinders, and a directional arrow. Uses raycasting