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
BoxOperationDecalOptions- A decal, as the receiving surface's own geometry clipped to a box and lifted off it.
FilmPatchOptionsLightVolumeOptionsMeshBuildOptions- 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.
RibbonMeshRibbonOptionsShellFillOptionsShellStation- One station along the model, from one end to the other.
SolidSplinePointSplineSample- One evaluated point. Written into by
sampleAt, never returned, because this runs inside the fixed tick. TextMeshStyleTreeGeometryTreeParams- Procedural trees from parameters and a seeded RNG.
Functions
boxBooleanCells- How many grid cells
solidBoxBooleanwould allocate foroperations. buildFilmPatchbuildLightVolume- Build the hull for a volume of light, in the volume's own space, opening along +Z.
buildRibbonbuildShellFill- A solid to stand inside a hollow model, sized from the space it has to fill.
buildTextMeshbuildTreeconcatMeshesmeshesas 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.
createSplineSampleemptySolidforEachCellforEachRun- 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.
hasGlyphmeasureText- 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.
placeMeshmeshscaled uniformly and then moved byx, 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.projectDecalshellFillMatrix- 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.
smoothSolidNormalssolidBox- 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
radiusat −length/2, apex at +length/2. solidCylinder- A cylinder of
radiusandlengthalong Y, centred, capped. solidExtrude- A polygon in XZ (
x, zpairs, either winding, convex or not) extruded along +Y from 0 toheight, or centred on the origin whencentreis 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
leveltimes onto a sphere ofradius. 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, ypairs, 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
xwide at −y/2, apex at +y/2 — extrudedzalong Z, centred.rightputs the apex over the base's left end, a right angle there. solidQuad- A single-sided plane of
xbyyin XY, facing +Z. The one open solid. solidRoundedBox- A box of full extents with every edge rounded to
radius,segmentssteps per rounded band. solidSphere- A sphere of
radius:segmentsaround, half as many from pole to pole. solidSubtract- Everything inside
aand outsideb. solidSweep- A profile (
x, ypairs in the plane across the path) swept along a polyline path (x, y, ztriples). At each point the frame is right = up × tangent, up' = tangent × right, so profile x runs right and profile y runs up;updefaults to +Y. Sides are faceted;capEndscloses 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.
emissiveis 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 radiusminor,segmentsaround andsidesacross. solidTube- A hollow cylinder: outer
radius, wallthickness,lengthalong 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.
transformSolidsolidmoved 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_HEIGHTGLYPH_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_Mfacet 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.