sub(a: V3, b: V3) → V3
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
cross(a: V3, b: V3) → V3
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
push(p: V3, nx: number, ny: number, nz: number, u: number, v: number, c: V3) → number
| arg | type | description |
|---|
| p | V3 | |
| nx | number | |
| ny | number | |
| nz | number | |
| u | number | |
| v | number | |
| c | V3 | |
aim(center: V3, inward: boolean?) → void
Every part declares the point its surface wraps. A quad whose face normal
ends up pointing at that point is emitted the other way round, so a loft that
travels off-axis — a winglet that climbs in Z more than it spans in X, a fin
that stands almost straight up — comes out solid instead of inside-out.
`inward` asks for the opposite, which is what a bore or a cockpit shell wants.
| arg | type | description |
|---|
| center | V3 | |
| inward | boolean? | |
facing(a: V3, b: V3, c: V3) → boolean
| arg | type | description |
|---|
| a | V3 | |
| b | V3 | |
| c | V3 | |
quad(a: ?, b: ?, c: ?, d: ?, ua: ?, va: ?, ub: ?, vb: ?, uc: ?, vc: ?, ud: ?, vd: ?, col: ?) → void
a → b → c → d, wound so the face normal is cross(b-a, c-a).
| arg | type | description |
|---|
| a | ? | |
| b | ? | |
| c | ? | |
| d | ? | |
| ua | ? | |
| va | ? | |
| ub | ? | |
| vb | ? | |
| uc | ? | |
| vc | ? | |
| ud | ? | |
| vd | ? | |
| col | ? | |
quadRaw(a: ?, b: ?, c: ?, d: ?, ua: ?, va: ?, ub: ?, vb: ?, uc: ?, vc: ?, ud: ?, vd: ?, col: ?) → void
| arg | type | description |
|---|
| a | ? | |
| b | ? | |
| c | ? | |
| d | ? | |
| ua | ? | |
| va | ? | |
| ub | ? | |
| vb | ? | |
| uc | ? | |
| vc | ? | |
| ud | ? | |
| vd | ? | |
| col | ? | |
tri(a: ?, b: ?, c: ?, ua: ?, va: ?, ub: ?, vb: ?, uc: ?, vc: ?, col: ?) → void
| arg | type | description |
|---|
| a | ? | |
| b | ? | |
| c | ? | |
| ua | ? | |
| va | ? | |
| ub | ? | |
| vb | ? | |
| uc | ? | |
| vc | ? | |
| col | ? | |
loft(ribs: ?, uvr: ?, tint: ?) → void
Loft a stack of ribs. Every rib is the same closed loop of points; quad
(rib[i][j], rib[i+1][j], rib[i+1][j+1], rib[i][j+1]) faces outward when the
loop runs the direction the part builders below establish.
`uvr` = { u0, v0, u1, v1 } — the atlas rectangle this surface occupies.
`tint(i, j)` returns the per-quad vertex colour.
| arg | type | description |
|---|
| ribs | ? | |
| uvr | ? | |
| tint | ? | |
fan(rib: ?, apex: ?, front: ?, uvr: ?, col: ?) → void
Close a loft with a fan to a point. `front` = the apex sits ahead of the rib
along the loft direction (a nose); false = behind it (a tail).
| arg | type | description |
|---|
| rib | ? | |
| apex | ? | |
| front | ? | |
| uvr | ? | |
| col | ? | |
ringXZ(profile: ?, sx: number, sz: number, cx: number, cz: number, y: number) → void
Rib helpers
A closed outline in the XZ plane, lifted to a rib at height `y`.
Loft along +Y with the SECTION profile below and the faces point outward.
| arg | type | description |
|---|
| profile | ? | |
| sx | number | |
| sz | number | |
| cx | number | |
| cz | number | |
| y | number | |
ribYZ(outline: ?, sy: number, sz: number, cy: number, cz: number, x: number, flip: boolean) → void
A closed outline in the YZ plane, lifted to a rib at station `x`.
Loft along +X with the AIRFOIL outline below and the faces point outward;
`flip` reverses the loop for a loft that runs the other way (the port wing).
| arg | type | description |
|---|
| outline | ? | |
| sy | number | |
| sz | number | |
| cy | number | |
| cz | number | |
| x | number | |
| flip | boolean | |
circle(n: number) → void
| arg | type | description |
|---|
| n | number | |
hash(a: number, b: number) → number
Deterministic wear
A fixed hash, so the same hull comes out of every rebuild: the streaks and
the replaced panels sit in the same places on every machine.
| arg | type | description |
|---|
| a | number | |
| b | number | |
shade(c: number) → void
| arg | type | description |
|---|
| c | number | |
fuselageTint(i: number, j: number) → void
| arg | type | description |
|---|
| i | number | |
| j | number | |
wingTint(i: number, j: number) → void
| arg | type | description |
|---|
| i | number | |
| j | number | |
flat(c: number) → void
| arg | type | description |
|---|
| c | number | |
buildFuselage(b: ?) → void
buildPanel(b: ?, spec: ?, side: number, uvr: ?, tint: ?) → void
A wing/fin panel, built for one side. `side` is +1 starboard, -1 port.
| arg | type | description |
|---|
| b | ? | |
| spec | ? | |
| side | number | |
| uvr | ? | |
| tint | ? | |
buildBarrel(b: ?, side: number) → void
| arg | type | description |
|---|
| b | ? | |
| side | number | |
buildBell(b: ?) → void
The engine housing ring at the tail; the flare inside it is a separate mesh.
canopyRibAt(t: number) → void
Mesh definitions
The canopy's frames: two hoops and a centre bar, standing proud of the
glass. They are what stops the canopy reading as a smoked blob — an eye
takes the frames for the shape and the glass for the hole between them.
| arg | type | description |
|---|
| t | number | |
buildCanopyFrame(b: ?) → void
trimGeometry( ) → void
The warning stripe: three chevrons laid on the upper wing root either side,
plus a band around the nose just aft of the gun ports.
plate(x0: ?, x1: ?, y0: ?, y1: ?, z: ?) → void
| arg | type | description |
|---|
| x0 | ? | |
| x1 | ? | |
| y0 | ? | |
| y1 | ? | |
| z | ? | |
ringBand(y0: ?, y1: ?, s0: ?, s1: ?) → void
| arg | type | description |
|---|
| y0 | ? | |
| y1 | ? | |
| s0 | ? | |
| s1 | ? | |
pilotGeometry( ) → void
The pilot, as a silhouette: shoulders, a helmet, and the visor plate that
catches the instrument light. Small, but it is what says "single-seat".
flareGeometry( ) → void
The thrust flare: a cone that lives inside the bell and is scaled per frame.
heatGeometry( ) → void
The gun-port heat rings: two collars around the barrel muzzles that the
slice drives off `state.heat`.
navGeometry(side: number) → void
One small emissive marker, reused for both nav lights at mirrored positions.
| arg | type | description |
|---|
| side | number | |
slab(b: ?, x0: ?, x1: ?, y0: ?, y1: ?, z0: ?, z1: ?, col: ?) → void
A control surface, built around its own hinge so the rig can just rotate it.
The aileron hinges on X (roll), the rudder on Z (yaw).
| arg | type | description |
|---|
| b | ? | |
| x0 | ? | |
| x1 | ? | |
| y0 | ? | |
| y1 | ? | |
| z0 | ? | |
| z1 | ? | |
| col | ? | |
face(a: ?, bb: ?, c: ?, d: ?, shade_: ?) → void
| arg | type | description |
|---|
| a | ? | |
| bb | ? | |
| c | ? | |
| d | ? | |
| shade_ | ? | |
aileronGeometry(side: number) → void
| arg | type | description |
|---|
| side | number | |
rudderGeometry(side: number) → void
| arg | type | description |
|---|
| side | number | |
runner_nav_port( ) → void
runner_nav_star( ) → void
runner_flap_port( ) → void
runner_flap_star( ) → void
runner_rud_port( ) → void
runner_rud_star( ) → void
geometryFor(name: string) → void
| arg | type | description |
|---|
| name | string | |