design
Turns a Car Forge description into what a car is made of, identically on every peer: `shape` (axles, belt line, pillars, roof line), `spec` (the body in torqueCars bodygen's loft vocabulary, with liveries, two-tone, decals and trim painted through its colour hook, and roof racks,…
design
Turns a Car Forge description into what a car is made of, identically on every peer: shape (axles, belt line, pillars, roof line), spec (the body in torqueCars bodygen's loft vocabulary, with liveries, two-tone, decals and trim painted through its colour hook, and roof racks, spoilers, tow bars and service beacons as extras), layout (seats, eye point, wheels with springs sized to the weight, and collider boxes that follow the body so a pickup's bed stays open), kind (the vehiclesKit vehicle: mass, balance, engine curve, gearing, brakes, assists), topSpeed and plate (an invented number plate). Used by carForge.mesh and carForge.vehicle.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
lerp(a: number, b: number, t: number) → number return a
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| t | number |
clamp(x: number, a: number, b: number) → number if x < a then return a elseif x > b then return b end return x end
| arg | type | description |
|---|---|---|
| x | number | |
| a | number | |
| b | number |
shape(d: any) → any
| arg | type | description |
|---|---|---|
| d | any |
plate(d: any) → string
The invented number plate of a car (letters and digits picked by plateSeed; no real format).
| arg | type | description |
|---|---|---|
| d | any |
lampSet(d: any, sh: any) → void
| arg | type | description |
|---|---|---|
| d | any | |
| sh | any |
painter(d: any, sh: any, look: any) → void
how the accent tone, trim and liveries are laid on (the loft's colour hook)
| arg | type | description |
|---|---|---|
| d | any | |
| sh | any | |
| look | any |
isGlassy(q: any, s: number, p: vector, n: vector) → boolean
| arg | type | description |
|---|---|---|
| q | any | |
| s | number | |
| p | vector | |
| n | vector |
roofKeys(d: any) → void
The body spec in bodygen's loft vocabulary for `bodygen.bodyFrom(M.loftKind(d), spec, look)`. The roof line's keys { { s, y } } (windscreen base -> roof front -> roof rear -> down the rear pillar), the loft's `roof` curve; layout reads it too, to keep the rear seats under the roof.
| arg | type | description |
|---|---|---|
| d | any |
profileKeys(d: any) → any
The body's profile keys along its length { bottom, deck, width = { { s, metres } } }: the floor line, the shoulder (bonnet, belt, boot) line and the half width; the loft's curves, read by layout too.
| arg | type | description |
|---|---|---|
| d | any |
archFlareFor(d: any, sh: any, look: any) → number
The arch flare: the car's own, or more where a wide tyre on a wide track would otherwise stand out past the body's side at an arch (the flare's lip then reaches 8 mm short of the tyre's outer face, a hubcap's dome included).
| arg | type | description |
|---|---|---|
| d | any | |
| sh | any | |
| look | any |
spec(d: any, loftLook: string) → any
| arg | type | description |
|---|---|---|
| d | any | |
| loftLook | string |
bumperSpec(depth: number) → any
| arg | type | description |
|---|---|---|
| depth | number |
extras(m: any, ctx: any, e: any) → void
| arg | type | description |
|---|---|---|
| m | any | |
| ctx | any | |
| e | any |
wells(d: any) → void
The wheel wells, front then rear: { { z, y, r (opening radius), x (how far in the well reaches) } }. What sits inside the body near an axle (the cabin's floor, seats and door cards) keeps inboard of x.
| arg | type | description |
|---|---|---|
| d | any |
maxSteer(d: any) → number
The front wheels' full steering lock (degrees): a longer wheelbase steers less.
| arg | type | description |
|---|---|---|
| d | any |
archGap(d: any) → number
The clearance between a tyre and its arch at rest (m): softer cars get more room.
| arg | type | description |
|---|---|---|
| d | any |
bedFloor(d: any) → number
A pickup's bed floor (m above the ground): deep, but always over the rear tyres and their arch gap.
| arg | type | description |
|---|---|---|
| d | any |
comHeight(d: any) → number
Height of the centre of mass (m): 30% up the body; a tall van's upper box is light sheet metal, so above 1.75 m only 12% of the extra height counts.
| arg | type | description |
|---|---|---|
| d | any |
loftKind(d: any) → any
| arg | type | description |
|---|---|---|
| d | any |
extras(d: any, sh: any, m: any, ctx: any, e: any, look: any) → void
Extra parts: roof racks, spoilers, tow bars, roof signs and beacons, push bars, roll hoops.
| arg | type | description |
|---|---|---|
| d | any | |
| sh | any | |
| m | any | |
| ctx | any | |
| e | any | |
| look | any |
roofAt(sv: number) → void
| arg | type | description |
|---|---|---|
| sv | number |
layout(d: any) → any
| arg | type | description |
|---|---|---|
| d | any |
topAt(sv: number) → number
| arg | type | description |
|---|---|---|
| sv | number |
over(s0: number, s1: number, f: (number) → void
| arg | type | description |
|---|---|---|
| s0 | number | |
| s1 | number | |
| f | (number |
addBox(s0: number, s1: number, y0: number, y1: number, half: number) → void
| arg | type | description |
|---|---|---|
| s0 | number | |
| s1 | number | |
| y0 | number | |
| y1 | number | |
| half | number |
cuts(list: { number }, longest: number) → void
| arg | type | description |
|---|---|---|
| list | { number } | |
| longest | number |
tierBox(tier: string, s0: number, s1: number, y0: number, y1: number, half: number) → void
| arg | type | description |
|---|---|---|
| tier | string | |
| s0 | number | |
| s1 | number | |
| y0 | number | |
| y1 | number | |
| half | number |
shoulder(sv: number) → number return cDeck
lower body in two tiers (its lower sides tuck in), up into the bonnet's and boot's crown
| arg | type | description |
|---|---|---|
| sv | number |
engineCurve(d: any) → void
| arg | type | description |
|---|---|---|
| d | any |
gearRatios(n: number, first: number, top: number) → void
| arg | type | description |
|---|---|---|
| n | number | |
| first | number | |
| top | number |
topSpeed(d: any) → number
Top speed (m/s) a car's power and drag allow.
| arg | type | description |
|---|---|---|
| d | any |
kind(d: any, name: string) → any
| arg | type | description |
|---|---|---|
| d | any | |
| name | string |
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.