The runtime

Geometry

72 symbols, imported from @driftengine/core.

Explained in Hello world, Meshes and geometry.

Classes

MeshBuilder
CPU-side accumulator that merges axis-aligned boxes into one static mesh — the entire grey-box world becomes a single draw call.
Spline

Interfaces

BoxOperation
DecalOptions
A decal, as the receiving surface's own geometry clipped to a box and lifted off it.
FilmPatchOptions
LightVolumeOptions
MeshBuildOptions
What the finished mesh should carry beyond position, normal, colour and emissive.
RibbonHole
A stretch of arc length where the surface simply is not there.
RibbonMesh
RibbonOptions
ShellFillOptions
ShellStation
One station along the model, from one end to the other.
Solid
SplinePoint
SplineSample
One evaluated point. Written into by sampleAt, never returned, because this runs inside the fixed tick.
TextMeshStyle
TreeGeometry
TreeParams
Procedural trees from parameters and a seeded RNG.

Functions

boxBooleanCells
How many grid cells solidBoxBoolean would allocate for operations.
buildFilmPatch
buildLightVolume
Build the hull for a volume of light, in the volume's own space, opening along +Z.
buildRibbon
buildShellFill
A solid to stand inside a hollow model, sized from the space it has to fill.
buildTextMesh
buildTree
concatMeshes
meshes as one, in order, each member's indices moved past the vertices before it.
countCells
How many lit cells a string needs, which is how many boxes it costs.
createSplineSample
emptySolid
forEachCell
forEachRun
Every horizontal run of lit cells, as one span each.
generateTangents
Derive a tangent frame from positions, normals and texture coordinates.
glyphRows
Rows for one character. Lower case is folded to upper: this is a display face for short shouted strings, and a 5x7 grid has no room for descenders.
hasGlyph
measureText
Width of a string in cells, spacing included, excluding the trailing gap.
mergeSolids
Several solids as one, each one's indices offset past the vertices before it.
placeMesh
mesh scaled uniformly and then moved by x, y, z. The same object when the fit is the identity; otherwise a copy of the positions and every other attribute shared, since a uniform scale turns no normal. Morph deltas are the caller's to scale.
projectDecal
shellFillMatrix
A uniform scale about a height, for drawing a skin just inside the model it came from.
shellSkin
The same surface, in one flat colour and facing both ways.
smoothSolidNormals
solidBox
A box of full extents x, y, z, faceted: four vertices a face, texture 0..1 across each.
solidBoxBoolean
The solid the operations make, applied left to right from nothing.
solidCapsule
A capsule: a cylinder of length (excluding the caps) with hemispherical ends, along Y.
solidCone
A cone: base radius at −length/2, apex at +length/2.
solidCylinder
A cylinder of radius and length along Y, centred, capped.
solidExtrude
A polygon in XZ (x, z pairs, either winding, convex or not) extruded along +Y from 0 to height, or centred on the origin when centre is set.
solidFrustum
A frustum with explicit radii at its bottom (−length/2) and top (+length/2), capped.
solidHemisphere
A dome toward +Y on a flat base at the origin.
solidIcosphere
An icosahedron subdivided level times onto a sphere of radius. Faceted by default — every triangle its own vertices and face normal — or smooth, sharing vertices with radial normals.
solidIntersect
Everything inside both solids.
solidLathe
A profile (r, y pairs, bottom to top) revolved around +Y. An end off the axis is closed with a flat cap, so any profile makes a solid. Every profile corner creases, faceted or smooth.
solidPrism
A triangular prism: the section in XY — base x wide at −y/2, apex at +y/2 — extruded z along Z, centred. right puts the apex over the base's left end, a right angle there.
solidQuad
A single-sided plane of x by y in XY, facing +Z. The one open solid.
solidRoundedBox
A box of full extents with every edge rounded to radius, segments steps per rounded band.
solidSphere
A sphere of radius: segments around, half as many from pole to pole.
solidSubtract
Everything inside a and outside b.
solidSweep
A profile (x, y pairs in the plane across the path) swept along a polyline path (x, y, z triples). At each point the frame is right = up × tangent, up' = tangent × right, so profile x runs right and profile y runs up; up defaults to +Y. Sides are faceted; capEnds closes both ends. Texture u runs around the profile and v along the path, both 0..1.
solidToMesh
A solid painted one colour, as a mesh the renderer draws. emissive is the usual scalar: the surface's own colour scaled, gated by the environment's night factor like every emissive.
solidTorus
A torus around +Y: ring radius major, tube radius minor, segments around and sides across.
solidTube
A hollow cylinder: outer radius, wall thickness, length along Y, centred. Four segments make a square frame.
solidUnion
Everything inside either solid.
solidVolume
The enclosed volume by the divergence theorem: the sum of each triangle's signed tetrahedron with the origin. Positive for a closed, outward-wound solid; meaningless for an open one.
textMeshHeightM
Height of a line in world units. Every glyph is the same seven cells tall.
textMeshWidthM
Width of a string in world units, before the basis is applied.
transformSolid
solid moved by a column-major 4×4 model matrix.

Constants

DEFAULT_SHELL_PROFILE
A plain inset block, which is the safe answer for a shape nothing is known about.
GLYPH_HEIGHT
GLYPH_SPACING
Blank columns between glyphs, in cells.
GLYPH_WIDTH
A 5x7 pixel font, as bitmasks.
RIBBON_COLLIDER_GIVE_M
Default collider give: comfortably past the sagitta of a RIBBON_STEP_M facet at the tightest curvature a route reaches (a hairpin near 6 m radius: 2² / (8 · 6) ≈ 0.08), because a give that only just covers the facet error still brushes the character at every ridge — felt as braking on exactly the curves a route wants taken at speed. Small enough that nothing passes through the gap: it is backed by solid hull immediately beneath, and only the top eases — sides and underside collide exactly where they are drawn.
RIBBON_STEP_M
Spacing of the cross-sections a ribbon's mesh is built from, metres.