roads
Procedural road and track pieces with real geometry: straight, curve, T and X junctions (filleted corners, stop lines), roundabout (kerbed island, arms clipped to the ring, give-way lines), ramp, kicker jump with table-top landing, banked turn (inside kerb, outside wall), guardra…
roads (roadPieces.roads)
Procedural road and track pieces with real geometry: straight, curve, T and X junctions (filleted corners, stop lines), roundabout (kerbed island, arms clipped to the ring, give-way lines), ramp, kicker jump with table-top landing, banked turn (inside kerb, outside wall), guardrail, concrete wall, tyre wall, and a Catmull-Rom spline road through any list of points that follows their heights. Three styles switched by one name: country (narrow two-lane tarmac, faded dashed centre line, grass verges, marker posts), highway (four lanes, edge lines, double centre line, concrete barriers) and dirt (rutted dirt track with gravel shoulders and a grass crown, no markings). build(spec) makes the mesh data, realize(root, built, style) stands it up as temporary children with static exact MeshColliders and driveSurfaces Surfaces, spawn(kind, opts) and spline(points, opts) place a RoadPiece, pathOf(road, offset?) returns its centreline in world space for AI drivers, and gallery(parent) lays out every piece in every style.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
groupMaterial(group: string, style: string) → any
Material per mesh group (literal references, so a push can pin them).
| arg | type | description |
|---|---|---|
| group | string | |
| style | string |
newMB( ) → MB
addVert(mb: MB, p: vector, n: vector, u: number, v: number, c: { number }) → number
| arg | type | description |
|---|---|---|
| mb | MB | |
| p | vector | |
| n | vector | |
| u | number | |
| v | number | |
| c | { number } |
tri(mb: MB, a: number, b: number, c: number) → void
| arg | type | description |
|---|---|---|
| mb | MB | |
| a | number | |
| b | number | |
| c | number |
safeNorm(v: vector) → vector
| arg | type | description |
|---|---|---|
| v | vector |
grid(mb: MB, P: { { vector } }, UV: { { vector } }, col: { number }, hint: vector?) → void
A grid of rows x cols points (rows run along the road, cols across). Normals come from the grid itself; `hint` (optional) is a direction the visible side must face, which decides the winding. uv[i][j] holds (u, v) in a vector's x, y.
| arg | type | description |
|---|---|---|
| mb | MB | |
| P | { { vector } } | |
| UV | { { vector } } | |
| col | { number } | |
| hint | vector? |
polygon(mb: MB, pts: { vector }, n: vector, col: { number }, uvOf: ((vector) → void
One flat-shaded polygon (convex, or star-shaped from p[1] when fan = true), facing `n`.
| arg | type | description |
|---|---|---|
| mb | MB | |
| pts | { vector } | |
| n | vector | |
| col | { number } | |
| uvOf | ((vector |
uv(p: vector) → void
| arg | type | description |
|---|---|---|
| p | vector |
box(mb: MB, c: vector, ax: vector, ay: vector, az: vector, hx: number, hy: number, hz: number, col: { number }) → void
An oriented box from its centre, three unit axes and half extents.
| arg | type | description |
|---|---|---|
| mb | MB | |
| c | vector | |
| ax | vector | |
| ay | vector | |
| az | vector | |
| hx | number | |
| hy | number | |
| hz | number | |
| col | { number } |
face(n: vector, u: vector, v: vector, hu: number, hv: number, hn: number) → void
| arg | type | description |
|---|---|---|
| n | vector | |
| u | vector | |
| v | vector | |
| hu | number | |
| hv | number | |
| hn | number |
frame(p: vector, t: vector, s: number) → Frame
| arg | type | description |
|---|---|---|
| p | vector | |
| t | vector | |
| s | number |
at(F: Frame, x: number, y: number) → vector
| arg | type | description |
|---|---|---|
| F | Frame | |
| x | number | |
| y | number |
banked(F: Frame, b: number) → Frame
Banked copy of a frame: roll about the tangent by `b` radians (positive lifts the left edge).
| arg | type | description |
|---|---|---|
| F | Frame | |
| b | number |
straightFrames(L: number, step: number?) → void
| arg | type | description |
|---|---|---|
| L | number | |
| step | number? |
arcFrames(R: number, angleDeg: number) → void
A flat arc from the origin heading -Z, turning right for a positive angle (degrees).
| arg | type | description |
|---|---|---|
| R | number | |
| angleDeg | number |
splineFrames(pts: { vector }, loop: boolean, step: number?) → void
Uniform Catmull-Rom through `pts` (vectors), sampled about every `step` metres.
| arg | type | description |
|---|---|---|
| pts | { vector } | |
| loop | boolean | |
| step | number? |
P(i: number) → vector
| arg | type | description |
|---|---|---|
| i | number |
G(groups: Groups, name: string) → MB
| arg | type | description |
|---|---|---|
| groups | Groups | |
| name | string |
deckProfile(st: Style, half: number, flat: boolean?) → void
| arg | type | description |
|---|---|---|
| st | Style | |
| half | number | |
| flat | boolean? |
deck(groups: Groups, frames: { Frame }, prof: { vector }, col: { number }, opts: { [string]: any }?) → void
Deck top over `frames` with `prof` (x lateral, y height above DECK), side skirts and optional end caps. `ground` = true drops skirts and caps to local y = 0 (ramps, banks).
| arg | type | description |
|---|---|---|
| groups | Groups | |
| frames | { Frame } | |
| prof | { vector } | |
| col | { number } | |
| opts | { [string]: any }? |
bottom(F: Frame, top: vector, x: number) → vector
| arg | type | description |
|---|---|---|
| F | Frame | |
| top | vector | |
| x | number |
cap(F: Frame, hint: vector) → void
| arg | type | description |
|---|---|---|
| F | Frame | |
| hint | vector |
verges(groups: Groups, frames: { Frame }, half: number, w: number) → void
Grass verges either side of a deck (flat at the piece's ground level).
| arg | type | description |
|---|---|---|
| groups | Groups | |
| frames | { Frame } | |
| half | number | |
| w | number |
railFrames(frames: { Frame }, x: number, y: number) → void
Upright frames along an offset line of `frames` (rails stand vertical even on a bank).
| arg | type | description |
|---|---|---|
| frames | { Frame } | |
| x | number | |
| y | number |
jersey(groups: Groups, rf: { Frame }, capEnds: boolean) → void
A New Jersey concrete barrier swept along upright frames `rf` (their p = barrier base centre).
| arg | type | description |
|---|---|---|
| groups | Groups | |
| rf | { Frame } | |
| capEnds | boolean |
guardrail(groups: Groups, rf: { Frame }, face: number) → void
A guardrail on upright frames `rf`; `face` = +1 when the road lies toward +r.
| arg | type | description |
|---|---|---|
| groups | Groups | |
| rf | { Frame } | |
| face | number |
delineators(groups: Groups, frames: { Frame }, x: number, every: number) → void
White delineator posts with a black band, every `every` metres at lateral x.
| arg | type | description |
|---|---|---|
| groups | Groups | |
| frames | { Frame } | |
| x | number | |
| every | number |
tyre(mb: MB, c: vector, ro: number, ri: number, h: number) → void
One tyre lying flat at `c` (its bottom), lathed.
| arg | type | description |
|---|---|---|
| mb | MB | |
| c | vector | |
| ro | number | |
| ri | number | |
| h | number |
tyreStacks(groups: Groups, frames: { Frame }, x: number, rowsCount: number) → void
| arg | type | description |
|---|---|---|
| groups | Groups | |
| frames | { Frame } | |
| x | number | |
| rowsCount | number |
rails(groups: Groups, frames: { Frame }, st: Style, half: number, mode: string, onDeck: boolean) → void
| arg | type | description |
|---|---|---|
| groups | Groups | |
| frames | { Frame } | |
| st | Style | |
| half | number | |
| mode | string | |
| onDeck | boolean |
plate(groups: Groups, x0: number, x1: number, z0: number, z1: number) → void
A flat grass plate (rectangle in local XZ) with a skirt round its edge.
| arg | type | description |
|---|---|---|
| groups | Groups | |
| x0 | number | |
| x1 | number | |
| z0 | number | |
| z1 | number |
fanPlate(groups: Groups, apex: vector, ring: { vector }, skirtEdges: { { vector } }, centre: vector) → void
A grass polygon fanned from `apex` (every point of `ring` must be visible from it), with a skirt down each edge listed in `skirtEdges` (pairs of points, outward hint from `centre`).
| arg | type | description |
|---|---|---|
| groups | Groups | |
| apex | vector | |
| ring | { vector } | |
| skirtEdges | { { vector } } | |
| centre | vector |
stripPlate(groups: Groups, inner: { vector }, outer: { vector }, centre: vector) → void
A ruled grass strip between two polylines sampled pairwise (`inner`[i] to `outer`[i]), with a skirt along the outer one.
| arg | type | description |
|---|---|---|
| groups | Groups | |
| inner | { vector } | |
| outer | { vector } | |
| centre | vector |
styleOf(spec: Spec) → void
| arg | type | description |
|---|---|---|
| spec | Spec |
basePlate(groups: Groups, margin: number) → void
A grass base plate under everything built so far, `margin` metres wider all round.
| arg | type | description |
|---|---|---|
| groups | Groups | |
| margin | number |
pathFrom(frames: { Frame }, y: number?) → void
| arg | type | description |
|---|---|---|
| frames | { Frame } | |
| y | number? |
linear(spec: Spec, frames: { Frame }) → Built
| arg | type | description |
|---|---|---|
| spec | Spec | |
| frames | { Frame } |
junction(spec: Spec, cross: boolean) → Built
| arg | type | description |
|---|---|---|
| spec | Spec | |
| cross | boolean |
roundabout(spec: Spec) → Built
| arg | type | description |
|---|---|---|
| spec | Spec |
ang(p: vector) → number
| arg | type | description |
|---|---|---|
| p | vector |
ramp(spec: Spec) → Built
| arg | type | description |
|---|---|---|
| spec | Spec |
kicker(spec: Spec) → Built
| arg | type | description |
|---|---|---|
| spec | Spec |
bankedTurn(spec: Spec) → Built
| arg | type | description |
|---|---|---|
| spec | Spec |
barrierPiece(spec: Spec, what: string) → Built
| arg | type | description |
|---|---|---|
| spec | Spec | |
| what | string |
build(spec: Spec) → Built
Build a piece's geometry (pure: makes mesh data, spawns nothing).
| arg | type | description |
|---|---|---|
| spec | Spec |
encodePoints(pts: { any }) → string
Points as text (a RoadPiece keeps its spline points in one string field: no list gaps, nothing to resolve).
| arg | type | description |
|---|---|---|
| pts | { any } |
decodePoints(s: string) → void
| arg | type | description |
|---|---|---|
| s | string |
specOf(c: any) → Spec
The spec a RoadPiece component's fields describe.
| arg | type | description |
|---|---|---|
| c | any |
spawn(kind: string, opts: { [string]: any }?) → any
Spawn a road piece. `opts` holds RoadPiece fields (style, length, radius, ...) plus `position`, `yaw` (degrees), `parent`, `name`, `synced`.
| arg | type | description |
|---|---|---|
| kind | string | |
| opts | { [string]: any }? |
spline(points: { any }, opts: { [string]: any }?) → any
A continuous road through `points` (world points with heights; vectors or {x,y,z}). `opts`: style, loop, verge, rails, width, name, parent, synced.
| arg | type | description |
|---|---|---|
| points | { any } | |
| opts | { [string]: any }? |
pieceOf(target: any) → void
| arg | type | description |
|---|---|---|
| target | any |
quatRotate(q: any, v: vector) → vector
| arg | type | description |
|---|---|---|
| q | any | |
| v | vector |
pathOf(roadEntity: any, offset: number?) → void
The centreline of a built road as world points (on the deck surface), and whether it loops. `offset` (optional, metres) shifts it to the right of the direction of travel (lane centres). Junctions answer their through road; a roundabout its ring, counter-clockwise from above.
| arg | type | description |
|---|---|---|
| roadEntity | any | |
| offset | number? |
realize(root: any, built: Built, style: string) → void
Stand a Built up under `root` as temporary child entities; returns the children and the runtime mesh handles (keep them while the children live).
| arg | type | description |
|---|---|---|
| root | any | |
| built | Built | |
| style | string |
label(parent: any, text: string, pos: { number }, h: number?) → any
Gallery: every piece in all three styles, side by side, with labels.
| arg | type | description |
|---|---|---|
| parent | any | |
| text | string | |
| pos | { number } | |
| h | number? |
gallery(parent: any?) → any
Lay every piece out in all three styles under a new root (rows of styles 100 m apart along +Z, columns of kinds along +X). Returns the root.
| arg | type | description |
|---|---|---|
| parent | any? |
Style = {Spec = {Built = { groups: Groups, path: { vector }, loop: boolean }Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.