Apex Raceway: Race Tracks, Laps and AI Rivals Kit
README.md
build
Stands a track up as geometry under a root entity. RaceTrack calls it on every peer from the track's synced fields, so the children it makes are temporary and internal: a scene stores only the RaceTrack record, and switching a surface or gate style rebuilds in place. It reads geometry for the shape, surfaces for the look and grip, gates for the gate meshes and materials for every material.
What it builds:
- road: the drivable ribbon with an exact mesh collider carrying the surface's physics ground (with bumps on offroad).
- edges: kerbs, verges, snow rims, glow strips, gravel or channel lips down both sides.
- barriers: the surface's barrier look both sides (tyre walls, hay, snow banks, glowing rails, rocks, channel walls) plus invisible collision walls.
- water: a water sheet over the sunken channel (water surface only).
- start: the checkered start/finish line and numbered grid boxes.
- gates: one gate per checkpoint in the chosen style, with START / FINISH and CHECKPOINT n labels.
- line: the racing line as a thin glowing ribbon, coloured by the speed profile (optional).
Functions
realize(root, track, opts?): builds every part underroot; returns a handle. Options:surface,gates,labels,barriers,showLine,linePoints,lineSpeeds.clear(handle): removes everythingrealizemade.animate(handle, time): moves the animated gate parts (rings spin, buoys bob, scan bars sweep, flags flutter).buildLine(handle, root, track, points, speeds?): lays just the racing line ribbon.spawnMesh,label,hash,bump: the mesh, 3D text, hashing and road-bump helpers the builders share.