Quick Reference
Setup & Creation 3
| prepareRockColumns() | Measure a map's rock columns on the background meshers before the map is laid (Reactor3D.beginPrepare waits f… |
| prepareNearRockChunks() | The rock chunks within ROCK_NEAR of focus meshed on the background meshers, into a cache a scene built from m… |
| prepareRockChunks() | Prepare reusable arrays off the main thread, before a host constructs the scene. |
Checks (True / False) 10
| hasTerrain() | Whether it has the terrain. |
| withinSweep() | Whether a ground point of a swept shape, at lx, lz from its middle in its own frame, lies within the arc. |
| isShapeKind() | Whether it is shape kind. |
| hasPieces() | Whether it has the pieces. |
| hasCover() | Whether a map has anything built that can stand in the way of a view: a piece that is not a ladder. |
| hasWater() | Whether it has the water. |
| isPrepared() | Whether it is prepared. |
| hasRocks() | Whether a map has any rock. |
| isMaterialCompanion() | Whether an image under img/materials is another material's normal or roughness map, not a material. |
| hasGround() | Whether it has the ground. |
Actions 3
| applyWaterLook() | Write a look into a sheet's material (one made by waterMaterial): as the sheet is laid, and again whenever th… |
| beginPrepare() | Begin prepare. |
| releaseGroundArrays() | A scene no longer wears its ground pictures (built again, or gone): the last one to wear a set lets it go. |
Events, Commands & Input 1
| emitPiece() | Triangles for one piece, in world units, appended to flat arrays. |
Other 139
| terrainOf() | Terrain of. |
| terrainHeightAt() | The terrain's rise at a world point (tile x spans world x..x+1), bilinear over its corners. |
| groundHeightAt() | Where the ground is at a world point: the cell's elevation plus the terrain's rise there. |
| viewGroundAt() | The ground a camera looks at, over a point that is not where anyone stands: the view's middle, which drifts o… |
| characterGround() | The ground under a character, at the middle of its cell as it moves between cells. |
| terrainBlocks() | A step between two cells the terrain makes too steep to take: the rise from either cell's middle to the middl… |
| stairAt() | Stair at. |
| stairPieceAt() | The stair on a cell, or null. |
| ladderAt() | The ladder on a cell: the way it climbs (a map direction, 2/4/6/8, toward the wall it leans on) and the world… |
| stairAxis() | The way a stair climbs, in cells: rot 0 rises south, each turn is clockwise seen from above. |
| displaceByTerrain() | Bend the built meshes through the terrain: every vertex rises by the field at its own x/z, so a tile top foll… |
| shapeParams() | Shape params. |
| materialLook() | What a material's name says about how it is drawn: a name beginning "Glass" is see-through (tinted, a third o… |
| glowColour() | Glow colour. |
| shapeCentre() | A shape's middle on the ground: its cell's middle plus its offset, in tiles. |
| shapeTurned() | Whether a shape is turned off the vertical (a tilt or a roll). |
| shapePlacer() | The map from a shape's unit cell (u across, y up, v along, each 0..1) to the world: stretched to its size, ro… |
| shapeSolidAt() | Whether a point of the ground, lx across and lz along from a shape's middle in its own turned frame (tiles),… |
| shapeSize() | A shape's [w, h, d] in tiles; a cell piece is one by one by its height. |
| pieceFootprint() | The cells a piece's footprint covers: one for a cell piece, w by d round the middle for a shape. |
| convexHull() | The convex hull of ground points [[x, z]], counter-clockwise, by monotone chain. |
| hullReach() | How far a ground point lies outside a convex hull: zero inside, else the distance to its edge. |
| pieceHeight() | Piece height. |
| pillarThick() | How thick a pillar is across, in tiles (0.4 when it says nothing; 0.1 a pole to 1 a tile-wide column). |
| normalizePiece() | Normalize piece. |
| pieceIndex() | The map's pieces, indexed by cell. |
| sharePieceIndex() | A copy of a map read from the same files (the one the game is handed over a border) takes the cell index the… |
| piecesOf() | Pieces of. |
| piecesAt() | Pieces at. |
| joinLadders() | Ladder levels given without a map (a preview of a ladder about to be laid): each is told which of its sides a… |
| pieceLocal() | Piece local. |
| pieceTop() | How high a piece's walkable top stands over the cell's ground at a point of the cell. |
| tiltedBoxTop() | The top of a tilted or rolled box over a ground point: a box is convex, so its top is the lowest of its upwar… |
| roofSlopeAt() | Whether what is stood on at a height on a cell is a roof's slope: a ramp, or a slab laid at a tilt. |
| pieceSurfaceAt() | What a character on the cell stands on, over the cell's ground, at a world point, given how high the characte… |
| pieceBaseAt() | The ground a piece stands on: the cell's elevation plus the terrain at its middle. |
| normalizeWater() | Normalize water. |
| waterLookOf() | A sheet's look beyond its image, only what was set: reflect (0-1, how much of the world its surface mirrors),… |
| hexToLinear() | A "#rrggbb" colour as light (linear r, g, b), written into out. |
| waterShade() | Everything a sheet's look comes to, in numbers: for the sheet's own shader, for the water seen through and fr… |
| waterMaskFor() | The raw sheet's mask cut to the region's box (the box may have been clamped to the map), or null when it cove… |
| waterCovers() | Whether a sheet stands over a cell. |
| waterOf() | Water of. |
| waterLevelAt() | The water level over a cell (a river's at the cell's middle), or null on dry land; the highest sheet wins. |
| waterSurfaceAt() | The water's surface at a world point (a river's exactly there, not its cell's), or null on dry land. |
| swimRule() | The physics' settings when the game swims (reactor_physics.js), else null: the editor and a game without phys… |
| waterDepthAt() | How deep the water stands over the ground at a world point; 0 on dry land. |
| waterBedAt() | The bed under a sheet at a world point, for how deep it looks: the ground, raised only by pieces lying wholly… |
| normalizeRiverPath() | A sheet's path and flow, or null when it has none (a level pond). |
| riverProfile() | What a river's path works out to, kept per sheet: its stretches (start, end, length, distance along the river… |
| riverLevelAlong() | The river's height and how fast it drops (tiles per tile) a distance s along it; out is filled. |
| riverSample() | The river at a world point: level, the way it runs (dx, dz, a unit vector), how fast it drops (slope), whethe… |
| riverSpeed() | How fast a river runs where it drops slope tiles per tile, in tiles a second: lazy on the flat, quick in rapi… |
| riverCells() | Each wet cell of a river: its level at the middle, the way and speed it runs, and whether it falls. |
| riverCellLevel() | A river's level at a cell's middle (the cell must be one it covers). |
| waterFlowAt() | Which way the water over a cell runs and how fast (dx, dz a unit vector, speed in tiles a second), or null wh… |
| riverFalls() | A river's waterfalls: each run of falling stretches as one fall, from its lip (x0, z0, top) to its foot (x1,… |
| terrainBaseY() | The Y of every vertex as built, kept so the terrain can lift it again later. |
| pieceShapes() | The shape of each kind in its own unit cell: x east, y up, v south, all 0..1. |
| mergeRanges() | Height ranges sorted and joined where they touch. |
| visibleSpans() | The parts of [y0, y1] that covered (true, false, or ranges) leaves showing. |
| rampHiddenSides() | Ramp hidden sides. |
| hiddenFacesOf() | Hidden faces of. |
| fenceJoins() | Fence joins. |
| previewPieces() | Pieces about to be laid at at (a cell and a level; the pieces are counted from it), as they will be drawn the… |
| pieceGeometry() | Piece geometry. |
| rockNoise() | Rock noise. |
| rockFrame() | A rock as the field reads it: its middle, its three axes (unit vectors), its half size along them, how round… |
| rockField() | The rock field at a world point: negative inside. |
| rockMesh() | Mesh the rocks frames inside the world box {x0, z0, x1, z1} (whole tiles, x1 and z1 exclusive) by surface net… |
| triplanarMaterial() | A material whose image is laid from all three sides by world position and blended by the surface's facing, ti… |
| rockGroundFloor() | The lowest the drawn ground goes in a cell (x, y): the least of its four corners plus its elevation, however… |
| rockSignature() | A rock as a key: where it stands and what shapes it, its ground included. |
| rockColumns() | Where the rocks stand, cell by cell, as the rock is drawn: at each cell's middle, the top of the rock mass th… |
| rockColumnsKnown() | Rock columns known. |
| keepRockColumns() | Keep rock columns. |
| rockColumnPlan() | The chunks rockColumns measures, each with the rocks that reach it and what it was measured from. |
| rockChunkColumns() | A chunk's columns as the field gives them, before the ground is taken off: for each cell of box (inside a map… |
| rockColumnsFinish() | A chunk's columns as the cell stacks keep them: the top over its rock's own ground, the foot over the cell's. |
| rockPiecesOf() | A map's rocks as the piece index holds them, in the same order, read without building the index (which measur… |
| defaultMaterialLoader() | Default material loader. |
| normalizeMaterialSettings() | A material's settings, each kept in range: scale the tiles one repeat of its image covers (null: a box piece'… |
| materialSettingsExist() | Whether img/materials holds <name>.json, by disk or a web build's file index. |
| readMaterialSettings() | The game's reading of <name>.json: at once off disk, in a browser when it arrives; null when there is none. |
| neutralDetailTexture() | A texture of no relief and no roughness: what a detail map shows until its own arrives. |
| packMaterialDetail() | One texture of a normal map (rgb) and a roughness map (a, from its red), either of which may be missing, at m… |
| _detailId() | Detail id. |
| _packMaterialDetail() | Pack material detail. |
| injectMaterialDetail() | A lit material's detail (the material's userData.rrDetail, from materialDetail): a box piece's repeat from it… |
| detailProgramKey() | A detail's part in a program's key: whether it scales, has maps, and how it is laid. |
| pieceChunkKey() | Piece chunk key. |
| pieceSurface() | A piece's surface: its own, else its finish's, else none. |
| surfaceKey() | A surface as a key: pieces shining alike share a draw. |
| pieceChunkLists() | The pieces of the chunks in wanted (all when null) by chunk and, in each, by material and surface (a mirror w… |
| rockChunkPlan() | Shared chunk boundaries and signatures for synchronous and worker builds. |
| rockLook() | What a rock face is drawn with: its bucket's key, material or cap, and surface. |
| rockGroundCap() | A rock capped with "ground" on a map with ground types wears the ground painted under its middle: that type's… |
| rockChunkBuckets() | A chunk's rock faces, meshed here: one bucket of arrays per material and cap. |
| rockGroundSignature() | The ground under and round a chunk as a number, so a terrain edit there meshes it again. |
| rockFocus() | Where the player stands, for which rocks to mesh first; the map's middle without one. |
| rockChunkJob() | The common worker payload and material lookup, also used by editor preloading. |
| rockWorkerSource() | The worker's whole program: the field, the mesher and the column measure, as written above, and its message l… |
| rockWorkerPool() | The background meshers, shared by every map: up to three workers (one core is the game's), made on first use. |
| waterUniforms() | The one clock every water sheet reads. |
| waterGlowShine() | One point of a glowing sheet's shine as the shader works it: swell from -1 (a trough) to 1 (a crest), vein fr… |
| waterGlowHeated() | The colour a glowing liquid of colour neon ([r, g, b], its strongest channel 1) burns at heat hot, into out. |
| waterMaterial() | Waves in the sheet's own shader: two swells cross the surface and lift the vertices, and the fragment is shad… |
| waterHazeMaterial() | One layer of the glow that hangs over a shining sheet: the sheet's own surface lifted a little, in its colour… |
| waterGeometry() | Water geometry. |
| riverGeometry() | River geometry. |
| fallGeometry() | Fall geometry. |
| fallFoot() | Where a fall's water lands, and how wide the foam there is. |
| fallMaterial() | The curtain's material. |
| fallLook() | What a fall reads of its river: the sheet's own live values when the river's material is given (rrFallTint, r… |
| shineAfterLight() | Shine after light. |
| foamMaterial() | Where a fall lands: a disc of churning foam on the water below, thickest in a ring where the curtain strikes,… |
| fallSprayGeometry() | Fall spray geometry. |
| fallSprayMaterial() | Fall spray material. |
| fallSprayBeforeRender() | The points' size is in screen pixels: the height of whatever the pass draws into, read as it draws. |
| riverHalfWidth() | How far a river's water reaches each way across its line at a point, on average (at least half a tile). |
| decodeGroundPaint() | Runs to levels: one byte per cell, size of them. |
| encodeGroundPaint() | Levels to runs, the trailing none left off. |
| normalizeGroundType() | Normalize ground type. |
| normalizeGround() | Normalize ground. |
| groundOf() | The map's ground types, normalized once per sidecar object (an edit writes a new one). |
| groundAt() | The ground a cell wears: { type, name, material, tint, scale, bare, level }, type its place in ground.types,… |
| groundBareAt() | Whether a cell wears a ground nothing grows on. |
| groundMaterialNames() | Every material the ground types name, once each. |
| groundTypesHeaderGLSL() | The shader's declarations for a scene's ground types (groundSlopeMaterial splices them in). |
| groundTypesBodyGLSL() | The types laid over the floor, in their order. |
| groundTypesUniforms() | A ground's uniforms on a compiled floor shader. |
| lineSolid() | One solid as a line meets it: the frame that place maps the box (x0, y0, v0)-(x1, y1, v1) into, and how the s… |
| lineInside() | Whether a point of a solid's frame is in the solid. |
| lineEnters() | Where a line, between t0 and t1 along it, enters a solid; -1 when it does not. |
| lineIndex() | What lines are tested against on a map: its shapes by the cells their boxes reach, and each cell's solids as… |
| lineCellPiece() | The solids of one cell piece, added to list. |
| lineCell() | The solids on a cell (null when it has none), built the first time a line comes to it. |
| worldRay() | How far along a line the world lets it go, at most far: from (ox, oy, oz) along the unit direction (dx, dy, d… |
| worldSolidAt() | Whether a world point is in the ground or in a solid part of what is built. |
Setup & Creation
prepareRockColumns
static sourceReactor3D.prepareRockColumns(mapData)
Measure a map's rock columns on the background meshers before the map is laid (Reactor3D.beginPrepare waits for it), so the cell stacks find every chunk measured: a map with a few hundred rocks no longer spends its first frame finding where they stand.
Details
Measure a map's rock columns on the background meshers before the map is laid (Reactor3D.beginPrepare waits for it), so the cell stacks find every chunk measured: a map with a few hundred rocks no longer spends its first frame finding where they stand. Null when there is nothing to wait for: no rock left to measure, or no workers (rockColumns then measures them where it is asked, as before).
prepareNearRockChunks
static sourceReactor3D.prepareNearRockChunks(mapData, focus)
The rock chunks within ROCK_NEAR of focus meshed on the background meshers, into a cache a scene built from mapData lays from (MapScene option rockChunkCache): the chunks a map meshes before it shows, meshed while it loads.
Details
The rock chunks within ROCK_NEAR of focus meshed on the background meshers, into a cache a scene
built from mapData lays from (MapScene option rockChunkCache): the chunks a map meshes before it
shows, meshed while it loads. Resolves with the cache; with no workers, empty.
prepareRockChunks
static sourceReactor3D.prepareRockChunks(mapData, cache = new Map()
Prepare reusable arrays off the main thread, before a host constructs the scene.
Checks (True / False)
hasTerrain
static sourceReactor3D.hasTerrain(mapData)
Whether it has the terrain.
withinSweep
static sourceReactor3D.withinSweep(sweep, lx, lz, slack)
Whether a ground point of a swept shape, at lx, lz from its middle in its own frame, lies within the arc.
isShapeKind
static sourceReactor3D.isShapeKind(kind)
Whether it is shape kind.
hasPieces
static sourceReactor3D.hasPieces(mapData)
Whether it has the pieces.
hasCover
static sourceReactor3D.hasCover(mapData)
Whether a map has anything built that can stand in the way of a view: a piece that is not a ladder.
Details
Whether a map has anything built that can stand in the way of a view: a piece that is not a ladder. A map whose only pieces are ladders has no inside to cut open and no wall to see through, and the cutaway leaves it alone: a ladder laid in a room with nothing else built switched the whole map's scenery to thinning in the sight line (the Reactor room's computers and tank, owner, 2026-11-14). Kept with the piece index.
hasWater
static sourceReactor3D.hasWater(mapData)
Whether it has the water.
isPrepared
static sourceReactor3D.isPrepared()
Whether it is prepared.
hasRocks
static sourceReactor3D.hasRocks(mapData)
Whether a map has any rock.
isMaterialCompanion
static sourceReactor3D.isMaterialCompanion(name)
Whether an image under img/materials is another material's normal or roughness map, not a material.
hasGround
static sourceReactor3D.hasGround(mapData)
Whether it has the ground.
Actions
applyWaterLook
static sourceReactor3D.applyWaterLook(material, look)
Write a look into a sheet's material (one made by waterMaterial): as the sheet is laid, and again whenever the look changes while the sheet stands (a slider in the editor).
Details
Write a look into a sheet's material (one made by waterMaterial): as the
sheet is laid, and again whenever the look changes while the sheet stands
(a slider in the editor). Returns what the look came to (waterShade).
beginPrepare
static sourceReactor3D.beginPrepare(mapData)
Begin prepare.
releaseGroundArrays
static sourceReactor3D.releaseGroundArrays(scene)
A scene no longer wears its ground pictures (built again, or gone): the last one to wear a set lets it go.
Events, Commands & Input
emitPiece
static sourceReactor3D.emitPiece(piece, base, out, hidden)
Triangles for one piece, in world units, appended to flat arrays.
Details
Triangles for one piece, in world units, appended to flat arrays. Faces carry planar world-space UVs (one image repeat per tile, so a row of blocks tiles seamlessly) and a per-vertex shade by facing, which is the only lighting a flat-shaded block gets: tops bright, undersides dark, the four sides each their own tone so edges read.
Other
terrainOf
static sourceReactor3D.terrainOf(mapData)
Terrain of.
terrainHeightAt
static sourceReactor3D.terrainHeightAt(mapData, wx, wz)
The terrain's rise at a world point (tile x spans world x..x+1), bilinear over its corners.
groundHeightAt
static sourceReactor3D.groundHeightAt(mapData, wx, wz, near)
Where the ground is at a world point: the cell's elevation plus the terrain's rise there.
viewGroundAt
static sourceReactor3D.viewGroundAt(mapData, wx, wz, near)
The ground a camera looks at, over a point that is not where anyone stands: the view's middle, which drifts over walls.
Details
The ground a camera looks at, over a point that is not where anyone stands:
the view's middle, which drifts over walls. A stack of walls reads as its
top (a character cannot step into it), so over a wall beside a door the view
jumped to the roof. More than a step above the player's own floor (near)
is not ground anyone is on; the player's floor is.
characterGround
static sourceReactor3D.characterGround(mapData, character)
The ground under a character, at the middle of its cell as it moves between cells.
terrainBlocks
static sourceReactor3D.terrainBlocks(mapData, x, y, x2, y2, near)
A step between two cells the terrain makes too steep to take: the rise from either cell's middle to the middle of the edge between them, or across the whole step.
Details
A step between two cells the terrain makes too steep to take: the rise from either cell's middle to the middle of the edge between them, or across the whole step. The edge is checked as well as the centres so a ridge on the shared corner, which two flat centres would not see, still blocks.
stairAt
static sourceReactor3D.stairAt(mapData, x, y)
Stair at.
stairPieceAt
static sourceReactor3D.stairPieceAt(mapData, x, y)
The stair on a cell, or null.
ladderAt
static sourceReactor3D.ladderAt(mapData, x, y)
The ladder on a cell: the way it climbs (a map direction, 2/4/6/8, toward the wall it leans on) and the world heights of its foot and its top.
stairAxis
static sourceReactor3D.stairAxis(rot)
The way a stair climbs, in cells: rot 0 rises south, each turn is clockwise seen from above.
displaceByTerrain
static sourceReactor3D.displaceByTerrain(built, mapData)
Bend the built meshes through the terrain: every vertex rises by the field at its own x/z, so a tile top follows its corners, a cliff face stays joined to the top it hangs from, and a standing cut-out (whose vertices share an anchor) rides up whole.
Details
Bend the built meshes through the terrain: every vertex rises by the field at its own x/z, so a tile top follows its corners, a cliff face stays joined to the top it hangs from, and a standing cut-out (whose vertices share an anchor) rides up whole. Tops and sides of a terrace keep their relative shape. Nothing to do on a map without terrain.
shapeParams
static sourceReactor3D.shapeParams(piece)
Shape params.
materialLook
static sourceReactor3D.materialLook(name)
What a material's name says about how it is drawn: a name beginning "Glass" is see-through (tinted, a third opaque, both faces), a name ending "Glow" is lit from within (full bright whatever the lights, so a console face or a light strip reads as a light source).
Details
What a material's name says about how it is drawn: a name beginning "Glass" is see-through (tinted, a third opaque, both faces), a name ending "Glow" is lit from within (full bright whatever the lights, so a console face or a light strip reads as a light source). Any other name is a tileable image under img/materials, shaded by the lights.
glowColour
static sourceReactor3D.glowColour(name)
Glow colour.
shapeCentre
static sourceReactor3D.shapeCentre(piece)
A shape's middle on the ground: its cell's middle plus its offset, in tiles.
shapeTurned
static sourceReactor3D.shapeTurned(piece)
Whether a shape is turned off the vertical (a tilt or a roll).
shapePlacer
static sourceReactor3D.shapePlacer(piece, base)
The map from a shape's unit cell (u across, y up, v along, each 0..1) to the world: stretched to its size, rolled about its own forward axis, tilted about its sideways axis, turned about the vertical, all about the middle of its box, then stood at its cell with its lowest corner at its height, so a rolled column lies on the ground.
Details
The map from a shape's unit cell (u across, y up, v along, each 0..1)
to the world: stretched to its size, rolled about its own forward axis,
tilted about its sideways axis, turned about the vertical, all about
the middle of its box, then stood at its cell with its lowest corner at
its height, so a rolled column lies on the ground. base is the ground
under the piece.
shapeSolidAt
static sourceReactor3D.shapeSolidAt(kind, lx, lz, hw, hd, slack, sweep, thick)
Whether a point of the ground, lx across and lz along from a shape's middle in its own turned frame (tiles), is under a solid part of the shape: a round one inside its ellipse, a hollow one in its wall, an arch or tunnel in its posts.
Details
Whether a point of the ground, lx across and lz along from a
shape's middle in its own turned frame (tiles), is under a solid part
of the shape: a round one inside its ellipse, a hollow one in its wall,
an arch or tunnel in its posts. slack widens the solid part so the
rim's cells block too.
shapeSize
static sourceReactor3D.shapeSize(piece)
A shape's [w, h, d] in tiles; a cell piece is one by one by its height.
pieceFootprint
static sourceReactor3D.pieceFootprint(piece)
The cells a piece's footprint covers: one for a cell piece, w by d round the middle for a shape.
convexHull
static sourceReactor3D.convexHull(points)
The convex hull of ground points [[x, z]], counter-clockwise, by monotone chain.
hullReach
static sourceReactor3D.hullReach(point, hull)
How far a ground point lies outside a convex hull: zero inside, else the distance to its edge.
pieceHeight
static sourceReactor3D.pieceHeight(kind, piece)
Piece height.
pillarThick
static sourceReactor3D.pillarThick(piece)
How thick a pillar is across, in tiles (0.4 when it says nothing; 0.1 a pole to 1 a tile-wide column).
normalizePiece
static sourceReactor3D.normalizePiece(raw, mapData)
Normalize piece.
pieceIndex
static sourceReactor3D.pieceIndex(mapData)
The map's pieces, indexed by cell.
Details
The map's pieces, indexed by cell. Cached against the sidecar's own array: the editor writes a new array on every change, so an edit is a new index and a frame's many ground lookups share one.
piecesOf
static sourceReactor3D.piecesOf(mapData)
Pieces of.
piecesAt
static sourceReactor3D.piecesAt(mapData, x, y)
Pieces at.
joinLadders
static sourceReactor3D.joinLadders(pieces)
Ladder levels given without a map (a preview of a ladder about to be laid): each is told which of its sides another level of the same list stands beside (ladderJoin), so they draw as one wide ladder, as laid ones do.
pieceLocal
static sourceReactor3D.pieceLocal(piece, u, v)
Piece local.
pieceTop
static sourceReactor3D.pieceTop(piece, u, v)
How high a piece's walkable top stands over the cell's ground at a point of the cell.
tiltedBoxTop
static sourceReactor3D.tiltedBoxTop(piece, at, wx, wz)
The top of a tilted or rolled box over a ground point: a box is convex, so its top is the lowest of its upward faces' planes there.
Details
The top of a tilted or rolled box over a ground point: a box is convex, so its top is the lowest of its upward faces' planes there. A point past its shadow reads the nearest point of the shadow (a cell of its footprint reaches a little beyond it). Its faces and shadow are kept per piece.
roofSlopeAt
static sourceReactor3D.roofSlopeAt(mapData, x, y, height)
Whether what is stood on at a height on a cell is a roof's slope: a ramp, or a slab laid at a tilt.
pieceSurfaceAt
static sourceReactor3D.pieceSurfaceAt(mapData, wx, wz, near, base)
What a character on the cell stands on, over the cell's ground, at a world point, given how high the character already stands (near).
Details
What a character on the cell stands on, over the cell's ground, at a
world point, given how high the character already stands (near).
The stack is read from the ground up. A piece whose foot is within a level and a step of the surface so far joins it (a floor on blocks, a wall on a wall). A piece higher than that opens a gap, and the gap is where the character's own height decides: within reach of the piece's foot, the character is on the upper layer and the surface jumps to it; out of reach, the character is on the lower layer and the reading stops. So a house has two walkable floors — downstairs you stand on the ground-floor slab under the upper floor, and coming up the stairs you arrive on the upper floor — a roof of ramps over either is never walked on, a doorway under a wall is the ground, a floor two levels up with nothing under it is a bridge walked under from below and a floor arrived at from a stair.
pieceBaseAt
static sourceReactor3D.pieceBaseAt(mapData, x, y)
The ground a piece stands on: the cell's elevation plus the terrain at its middle.
normalizeWater
static sourceReactor3D.normalizeWater(raw, mapData)
Normalize water.
waterLookOf
static sourceReactor3D.waterLookOf(raw)
A sheet's look beyond its image, only what was set: reflect (0-1, how much of the world its surface mirrors), gloss (0-1, 1 a clean mirror) and tint (the colour the reflection takes).
Details
A sheet's look beyond its image, only what was set: reflect (0-1, how
much of the world its surface mirrors), gloss (0-1, 1 a clean mirror)
and tint (the colour the reflection takes). Mercury is all three high:
reflect 1, gloss 0.9, a pale steel tint.
hexToLinear
static sourceReactor3D.hexToLinear(hex, out)
A "#rrggbb" colour as light (linear r, g, b), written into out.
waterShade
static sourceReactor3D.waterShade(look, out)
Everything a sheet's look comes to, in numbers: for the sheet's own shader, for the water seen through and from inside it, for the light it gives the map and for the haze over it.
Details
Everything a sheet's look comes to, in numbers: for the sheet's own shader,
for the water seen through and from inside it, for the light it gives the
map and for the haze over it. The game and the editor both read a look
through here (a slider in the editor writes the result straight into the
sheet's uniforms), so they draw the same thing for the same value; and every
value moves smoothly with glow and clear, with no step anywhere between
0 and 1.
glow as set, 0-1
neon the colour it shines (its own, else water's blue), its strongest channel at 1
emit how brightly it shines, over whatever light falls on it (the night does not dim it)
cover how opaque the shine makes it
fog [r, g, b, density]: the liquid seen through, lit from within by the glow
light how strongly it lights its surroundings
shape the power its light's falloff is raised to (a faint glow stays a little closer to the water)
haze how thick the glow hangs over it
halo how strongly its light bleeds into the picture round it, 0-1: none until the shine passes
WATER_HALO_FROM, then in step with the shine (a faint rim at a third, neon at full)
waterMaskFor
static sourceReactor3D.waterMaskFor(raw, region)
The raw sheet's mask cut to the region's box (the box may have been clamped to the map), or null when it covers the box.
waterCovers
static sourceReactor3D.waterCovers(region, x, y)
Whether a sheet stands over a cell.
waterOf
static sourceReactor3D.waterOf(mapData)
Water of.
waterLevelAt
static sourceReactor3D.waterLevelAt(mapData, x, y)
The water level over a cell (a river's at the cell's middle), or null on dry land; the highest sheet wins.
waterSurfaceAt
static sourceReactor3D.waterSurfaceAt(mapData, wx, wz)
The water's surface at a world point (a river's exactly there, not its cell's), or null on dry land.
swimRule
static sourceReactor3D.swimRule()
The physics' settings when the game swims (reactor_physics.js), else null: the editor and a game without physics keep deep water impassable.
waterDepthAt
static sourceReactor3D.waterDepthAt(mapData, wx, wz, near)
How deep the water stands over the ground at a world point; 0 on dry land.
waterBedAt
static sourceReactor3D.waterBedAt(mapData, wx, wz, level)
The bed under a sheet at a world point, for how deep it looks: the ground, raised only by pieces lying wholly under the surface (a sunken floor, a slab on the bottom).
Details
The bed under a sheet at a world point, for how deep it looks: the ground, raised only by pieces lying wholly under the surface (a sunken floor, a slab on the bottom). What stands up through the water (a jetty's posts and deck, a moored boat, a wall) is not the bed: the water runs on round and under it at its own depth, so it neither fades out nor turns clear there.
normalizeRiverPath
static sourceReactor3D.normalizeRiverPath(raw, mapData)
A sheet's path and flow, or null when it has none (a level pond).
riverProfile
static sourceReactor3D.riverProfile(region)
What a river's path works out to, kept per sheet: its stretches (start, end, length, distance along the river where each starts, direction), which of them fall, and the eased slope at each point.
Details
What a river's path works out to, kept per sheet: its stretches (start, end, length, distance along the river where each starts, direction), which of them fall, and the eased slope at each point. Built once.
riverLevelAlong
static sourceReactor3D.riverLevelAlong(region, profile, s, out)
The river's height and how fast it drops (tiles per tile) a distance s along it; out is filled.
riverSample
static sourceReactor3D.riverSample(region, wx, wz, out = this._riverScratch || (this._riverScratch = {})
The river at a world point: level, the way it runs (dx, dz, a unit vector), how fast it drops (slope), whether the point is on a waterfall (fall), how far along the river it is (s) and how far from its line (distance).
Details
The river at a world point: level, the way it runs (dx, dz, a unit
vector), how fast it drops (slope), whether the point is on a waterfall
(fall), how far along the river it is (s) and how far from its line
(distance). Each stretch near the point is projected onto and their
distances along blended, nearest weighing most, so crossing from one
stretch's side of a bend to the next's moves the surface smoothly.
out is filled and returned (one shared object when none is given).
riverSpeed
static sourceReactor3D.riverSpeed(slope, flow)
How fast a river runs where it drops slope tiles per tile, in tiles a second: lazy on the flat, quick in rapids.
riverCells
static sourceReactor3D.riverCells(region)
Each wet cell of a river: its level at the middle, the way and speed it runs, and whether it falls.
Details
Each wet cell of a river: its level at the middle, the way and speed it runs, and whether it falls. Built once.
riverCellLevel
static sourceReactor3D.riverCellLevel(region, x, y)
A river's level at a cell's middle (the cell must be one it covers).
waterFlowAt
static sourceReactor3D.waterFlowAt(mapData, x, y)
Which way the water over a cell runs and how fast (dx, dz a unit vector, speed in tiles a second), or null where it stands still or there is none: the highest sheet over the cell decides, as for its level.
Details
Which way the water over a cell runs and how fast (dx, dz a unit
vector, speed in tiles a second), or null where it stands still or there
is none: the highest sheet over the cell decides, as for its level.
riverFalls
static sourceReactor3D.riverFalls(region)
A river's waterfalls: each run of falling stretches as one fall, from its lip (x0, z0, top) to its foot (x1, z1, bottom), the way it falls (dx, dz) and how wide it is (half each side of x0/z0 shifted by offset across), the width measured on the mask just upstream of the lip.
Details
A river's waterfalls: each run of falling stretches as one fall, from its
lip (x0, z0, top) to its foot (x1, z1, bottom), the way it
falls (dx, dz) and how wide it is (half each side of x0/z0
shifted by offset across), the width measured on the mask just upstream
of the lip. Built once.
terrainBaseY
static sourceReactor3D.terrainBaseY(positions)
The Y of every vertex as built, kept so the terrain can lift it again later.
pieceShapes
static sourceReactor3D.pieceShapes(kind, piece)
The shape of each kind in its own unit cell: x east, y up, v south, all 0..1.
Details
The shape of each kind in its own unit cell: x east, y up, v south, all
0..1. A piece is a few boxes, a wedge (rises along +v), a gable (a ridge
across the middle, eaves at v 0 and 1) or a column. Turned by rot
quarter turns about the cell's middle when it is laid down.
mergeRanges
static sourceReactor3D.mergeRanges(ranges)
Height ranges sorted and joined where they touch.
visibleSpans
static sourceReactor3D.visibleSpans(y0, y1, covered)
The parts of [y0, y1] that covered (true, false, or ranges) leaves showing.
rampHiddenSides
static sourceReactor3D.rampHiddenSides(piece, mapData)
Ramp hidden sides.
fenceJoins
static sourceReactor3D.fenceJoins(piece, index)
Fence joins.
previewPieces
static sourceReactor3D.previewPieces(pieces, mapData, at)
Pieces about to be laid at at (a cell and a level; the pieces are counted from it), as they will be drawn there: each is told what the laid one would find on the map and beside it in the run.
Details
Pieces about to be laid at at (a cell and a level; the pieces are counted from it), as they will be drawn
there: each is told what the laid one would find on the map and beside it in the run. A ladder's level joins
the level beside it, a fence joins the fences and walls round it, a raised stair's support stops on what is
under it, and each stands on its own cell's ground (previewBase, from the ground at at). The answer is
for pieceGeometry(pieces, null): a preview is drawn with no map, so found none of this (a ladder 3 wide
previewed as three ladders, owner, 2026-11-13).
pieceGeometry
static sourceReactor3D.pieceGeometry(pieces, mapData)
Piece geometry.
rockNoise
static sourceReactor3D.rockNoise(x, y, z, octaves)
Rock noise.
rockFrame
static sourceReactor3D.rockFrame(piece, base)
A rock as the field reads it: its middle, its three axes (unit vectors), its half size along them, how round its edges are and how rough it is, and the world box it can reach.
Details
A rock as the field reads it: its middle, its three axes (unit vectors),
its half size along them, how round its edges are and how rough it is,
and the world box it can reach. A rock on the ground (under a quarter
tile up, not tilted) reaches ROCK_SINK further down.
rockField
static sourceReactor3D.rockField(frames, x, y, z, near)
The rock field at a world point: negative inside.
Details
The rock field at a world point: negative inside. near receives the
index of the rock that decides the point (its material and roughness).
rockMesh
static sourceReactor3D.rockMesh(frames, box, bucketFor, groundFloor)
Mesh the rocks frames inside the world box {x0, z0, x1, z1} (whole tiles, x1 and z1 exclusive) by surface nets on the ROCK_STEP grid.
Details
Mesh the rocks frames inside the world box {x0, z0, x1, z1} (whole
tiles, x1 and z1 exclusive) by surface nets on the ROCK_STEP grid. Each
face goes into bucketFor(frame, capped)'s arrays (positions, uvs,
colors), so a chunk can split them by material and cap. Faces are owned by the box they start
in, so boxes side by side mesh one seamless surface. With groundFloor (rockGroundFloor), a
face lower than the ground of every cell it spans is left out: a rock's foot reaches a tile into it.
triplanarMaterial
static sourceReactor3D.triplanarMaterial(material, tiles)
A material whose image is laid from all three sides by world position and blended by the surface's facing, tiles world tiles to a repeat: a rock's crags turn every way, and a face's own projection jumped between neighbours.
rockGroundFloor
static sourceReactor3D.rockGroundFloor(mapData)
The lowest the drawn ground goes in a cell (x, y): the least of its four corners plus its elevation, however the cell's ground is cut into triangles.
Details
The lowest the drawn ground goes in a cell (x, y): the least of its four corners plus its elevation, however the cell's ground is cut into triangles. Off the map there is no ground to hide anything: -Infinity.
rockSignature
static sourceReactor3D.rockSignature(f)
A rock as a key: where it stands and what shapes it, its ground included.
rockColumns
static sourceReactor3D.rockColumns(mapData, rocks)
Where the rocks stand, cell by cell, as the rock is drawn: at each cell's middle, the top of the rock mass there (found from above, then halved in) and how far down it goes before it opens, so a party stands on the rock it sees, is stopped by a bulge past a rock's box, and walks under an arch.
Details
Where the rocks stand, cell by cell, as the rock is drawn: at each cell's middle, the top of the rock mass there (found from above, then halved in) and how far down it goes before it opens, so a party stands on the rock it sees, is stopped by a bulge past a rock's box, and walks under an arch. Each entry is {x, y, piece (the rock whose surface it is), top (over that rock's own ground, as a shape's top is), z (the mass's foot over the cell's ground; 0 when it reaches the ground)}. Measured a chunk at a time and kept by the rocks that reach it, so an edit measures only its chunks.
rockColumnsKnown
static sourceReactor3D.rockColumnsKnown(key, sig)
Rock columns known.
keepRockColumns
static sourceReactor3D.keepRockColumns(key, sig, columns)
Keep rock columns.
rockColumnPlan
static sourceReactor3D.rockColumnPlan(mapData, rocks)
The chunks rockColumns measures, each with the rocks that reach it and what it was measured from.
rockChunkColumns
static sourceReactor3D.rockChunkColumns(reaching, box, W, H)
A chunk's columns as the field gives them, before the ground is taken off: for each cell of box (inside a map W by H) a rock reaches, { x, y, owner, top, foot }, owner the index in reaching of the rock whose surface it is and top and foot world heights.
Details
A chunk's columns as the field gives them, before the ground is taken off: for each cell of box
(inside a map W by H) a rock reaches, { x, y, owner, top, foot }, owner the index in
reaching of the rock whose surface it is and top and foot world heights. Reads nothing but
its arguments and the field, so a worker runs it as written (rockWorkerSource).
rockColumnsFinish
static sourceReactor3D.rockColumnsFinish(mapData, reaching, raw)
A chunk's columns as the cell stacks keep them: the top over its rock's own ground, the foot over the cell's.
rockPiecesOf
static sourceReactor3D.rockPiecesOf(mapData)
A map's rocks as the piece index holds them, in the same order, read without building the index (which measures them).
defaultMaterialLoader
static sourceReactor3D.defaultMaterialLoader(name)
Default material loader.
normalizeMaterialSettings
static sourceReactor3D.normalizeMaterialSettings(raw)
A material's settings, each kept in range: scale the tiles one repeat of its image covers (null: a box piece's one per tile, a rock's ROCK_UV), gloss how smooth its smoothest parts are (0 matte, 1 polished), reflect how much sky a smooth part mirrors at a glancing angle, normalStrength how deep the normal map's relief reads.
Details
A material's settings, each kept in range: scale the tiles one repeat of its
image covers (null: a box piece's one per tile, a rock's ROCK_UV), gloss how
smooth its smoothest parts are (0 matte, 1 polished), reflect how much sky
a smooth part mirrors at a glancing angle, normalStrength how deep the
normal map's relief reads.
materialSettingsExist
static sourceReactor3D.materialSettingsExist(name)
Whether img/materials holds <name>.json, by disk or a web build's file index.
readMaterialSettings
static sourceReactor3D.readMaterialSettings(name, done)
The game's reading of <name>.json: at once off disk, in a browser when it arrives; null when there is none.
neutralDetailTexture
static sourceReactor3D.neutralDetailTexture()
A texture of no relief and no roughness: what a detail map shows until its own arrives.
packMaterialDetail
static sourceReactor3D.packMaterialDetail(normal, rough, maxSize)
One texture of a normal map (rgb) and a roughness map (a, from its red), either of which may be missing, at most maxSize on a side.
Details
One texture of a normal map (rgb) and a roughness map (a, from its red), either
of which may be missing, at most maxSize on a side. Rows are stored bottom up,
so it lines up with the material's own image (three flips that one on upload).
_detailId
static internal sourceReactor3D._detailId(object)
Detail id.
_packMaterialDetail
static internal sourceReactor3D._packMaterialDetail(normal, rough, maxSize)
Pack material detail.
injectMaterialDetail
static sourceReactor3D.injectMaterialDetail(material, shader)
A lit material's detail (the material's userData.rrDetail, from materialDetail): a box piece's repeat from its settings, a rock's through its triplanar scale, and, when it has maps, the relief and sheen after its colour is set (before the light, so a material the light is worked out apart from — HalfLight — keeps it).
detailProgramKey
static sourceReactor3D.detailProgramKey(material)
A detail's part in a program's key: whether it scales, has maps, and how it is laid.
pieceChunkKey
static sourceReactor3D.pieceChunkKey(x, y)
Piece chunk key.
pieceSurface
static sourceReactor3D.pieceSurface(piece)
A piece's surface: its own, else its finish's, else none.
surfaceKey
static sourceReactor3D.surfaceKey(surface)
A surface as a key: pieces shining alike share a draw.
pieceChunkLists
static sourceReactor3D.pieceChunkLists(mapData, wanted)
The pieces of the chunks in wanted (all when null) by chunk and, in each, by material and surface (a mirror wall is its own draw), in the order they are laid; the rocks apart, which are meshed by the rock field.
Details
The pieces of the chunks in wanted (all when null) by chunk and, in each, by material and surface
(a mirror wall is its own draw), in the order they are laid; the rocks apart, which are meshed by the
rock field. Door casings and window frames are laid with the pieces, in their own materials
(reactor_3d_doors.js).
rockChunkPlan
static sourceReactor3D.rockChunkPlan(mapData, rocks, wanted)
Shared chunk boundaries and signatures for synchronous and worker builds.
rockLook
static sourceReactor3D.rockLook(frame, capped)
What a rock face is drawn with: its bucket's key, material or cap, and surface.
rockGroundCap
static sourceReactor3D.rockGroundCap(mapData, frame)
A rock capped with "ground" on a map with ground types wears the ground painted under its middle: that type's material and tint.
Details
A rock capped with "ground" on a map with ground types wears the ground painted under its middle: that type's material and tint. Where none is painted it keeps the room's floor.
rockChunkBuckets
static sourceReactor3D.rockChunkBuckets(reaching, box, floor)
A chunk's rock faces, meshed here: one bucket of arrays per material and cap.
rockGroundSignature
static sourceReactor3D.rockGroundSignature(floor, box)
The ground under and round a chunk as a number, so a terrain edit there meshes it again.
rockFocus
static sourceReactor3D.rockFocus(mapData)
Where the player stands, for which rocks to mesh first; the map's middle without one.
rockChunkJob
static sourceReactor3D.rockChunkJob(job, floor)
The common worker payload and material lookup, also used by editor preloading.
rockWorkerSource
static sourceReactor3D.rockWorkerSource()
The worker's whole program: the field, the mesher and the column measure, as written above, and its message loop.
rockWorkerPool
static sourceReactor3D.rockWorkerPool()
The background meshers, shared by every map: up to three workers (one core is the game's), made on first use.
Details
The background meshers, shared by every map: up to three workers (one core is the game's), made on first use. Null where workers cannot run. A worker that fails hands its work back: the rest is meshed here, a chunk a turn. While the game in play is short of its frames (Reactor3D.FramePressure) the work is handed to one mesher at a time, until what is queued is done: three beside the game were more threads than a four-core processor had to give, and it was the game that waited.
waterUniforms
static sourceReactor3D.waterUniforms()
The one clock every water sheet reads.
waterGlowShine
static sourceReactor3D.waterGlowShine(swell, vein, drift, facet = 0.5, out = {})
One point of a glowing sheet's shine as the shader works it: swell from -1 (a trough) to 1 (a crest), vein from 0 to 1.4 (in a vein's core), drift from -1 to 1, facet 0 to 1 (0.5 where no ripple shows).
Details
One point of a glowing sheet's shine as the shader works it: swell from
-1 (a trough) to 1 (a crest), vein from 0 to 1.4 (in a vein's core),
drift from -1 to 1, facet 0 to 1 (0.5 where no ripple shows). Into
out: shine (times the look's emit) and hot (its heat, times the glow).
waterGlowHeated
static sourceReactor3D.waterGlowHeated(neon, hot, out = [0, 0, 0])
The colour a glowing liquid of colour neon ([r, g, b], its strongest channel 1) burns at heat hot, into out.
Details
The colour a glowing liquid of colour neon ([r, g, b], its strongest channel 1) burns at heat hot, into out.
waterMaterial
static sourceReactor3D.waterMaterial(texture, look)
Waves in the sheet's own shader: two swells cross the surface and lift the vertices, and the fragment is shaded by RIVER_MAP_GLSL and RIVER_SHADE_GLSL, a still sheet as a river with a breath of wind across it: coloured by its depth, mirroring by its Fresnel term (and toward a full mirror as reflect rises past water's 0.45), glinting off its ripples, fading out where the ground rises to meet it, s…
Details
Waves in the sheet's own shader: two swells cross the surface and lift
the vertices, and the fragment is shaded by RIVER_MAP_GLSL and
RIVER_SHADE_GLSL, a still sheet as a river with a breath of wind across
it: coloured by its depth, mirroring by its Fresnel term (and toward a
full mirror as reflect rises past water's 0.45), glinting off its
ripples, fading out where the ground rises to meet it, so a shore is a
shore. A liquid's colour, clear, waves and glow say what it is.
waterHazeMaterial
static sourceReactor3D.waterHazeMaterial(shared, lift, weight)
One layer of the glow that hangs over a shining sheet: the sheet's own surface lifted a little, in its colour, thicker seen along the water than down onto it and gone at the shore.
Details
One layer of the glow that hangs over a shining sheet: the sheet's own
surface lifted a little, in its colour, thicker seen along the water than
down onto it and gone at the shore. Drawn with the lights' haze (at a
quarter size, behind whatever stands in front), so shared is the sheet's
rrWaterHaze (colour and strength, moved by applyWaterLook).
waterGeometry
static sourceReactor3D.waterGeometry(region, mapData, shore = true, others = null)
Water geometry.
riverGeometry
static sourceReactor3D.riverGeometry(region, mapData, shore = true, others = null)
River geometry.
fallGeometry
static sourceReactor3D.fallGeometry(fall)
Fall geometry.
fallFoot
static sourceReactor3D.fallFoot(fall)
Where a fall's water lands, and how wide the foam there is.
fallMaterial
static sourceReactor3D.fallMaterial(texture, region, drop, sheet)
The curtain's material.
Details
The curtain's material. Three layers of the image stream down at
different speeds and scales, with ropes of water across it at uneven
spacing; where they are thin the curtain is a dark, see-through sheet
over the rock, where they gather it is white. Glassy at the lip, which
catches the light; broken up and whiter as it falls; its sides ragged
and shifting, not a ruled edge. Lit like the rest of the water, and
shining as its river does: sheet is the river's own material, whose
colour and glow the curtain reads live (a look changed on the sheet shows
on its falls at once). One per fall (its speed is the drop's).
fallLook
static sourceReactor3D.fallLook(region, sheet)
What a fall reads of its river: the sheet's own live values when the river's material is given (rrFallTint, rrWaterGlow, rrWaterForm, each the very object the sheet's uniforms hold), else the same worked from the region's look.
Details
What a fall reads of its river: the sheet's own live values when the
river's material is given (rrFallTint, rrWaterGlow, rrWaterForm,
each the very object the sheet's uniforms hold), else the same worked
from the region's look.
shineAfterLight
static sourceReactor3D.shineAfterLight(material)
Shine after light.
foamMaterial
static sourceReactor3D.foamMaterial(texture, region, sheet)
Where a fall lands: a disc of churning foam on the water below, thickest in a ring where the curtain strikes, boiling outward in patches and thinning out at the rim.
Details
Where a fall lands: a disc of churning foam on the water below, thickest
in a ring where the curtain strikes, boiling outward in patches and
thinning out at the rim. Under a glowing river's fall it shines, pale, in
the river's colour (region, sheet: as fallMaterial takes them).
fallSprayGeometry
static sourceReactor3D.fallSprayGeometry(fall, foot)
Fall spray geometry.
fallSprayMaterial
static sourceReactor3D.fallSprayMaterial(fall, foot, region, sheet)
Fall spray material.
fallSprayBeforeRender
static sourceReactor3D.fallSprayBeforeRender(renderer, scene, camera, geometry, material)
The points' size is in screen pixels: the height of whatever the pass draws into, read as it draws.
riverHalfWidth
static sourceReactor3D.riverHalfWidth(region, x, z, ux, uz)
How far a river's water reaches each way across its line at a point, on average (at least half a tile).
decodeGroundPaint
static sourceReactor3D.decodeGroundPaint(text, size)
Runs to levels: one byte per cell, size of them.
Details
Runs to levels: one byte per cell, size of them. Unknown tokens read as none.
encodeGroundPaint
static sourceReactor3D.encodeGroundPaint(levels)
Levels to runs, the trailing none left off.
normalizeGroundType
static sourceReactor3D.normalizeGroundType(raw, mapData)
Normalize ground type.
normalizeGround
static sourceReactor3D.normalizeGround(raw, mapData)
Normalize ground.
groundOf
static sourceReactor3D.groundOf(mapData)
The map's ground types, normalized once per sidecar object (an edit writes a new one).
groundAt
static sourceReactor3D.groundAt(mapData, x, y)
The ground a cell wears: { type, name, material, tint, scale, bare, level }, type its place in ground.types, or -1 with the room's floor as material where none is painted solid.
Details
The ground a cell wears: { type, name, material, tint, scale, bare, level }, type its place
in ground.types, or -1 with the room's floor as material where none is painted solid.
Cells off the map answer for the nearest cell on it.
groundBareAt
static sourceReactor3D.groundBareAt(mapData, x, y)
Whether a cell wears a ground nothing grows on.
groundMaterialNames
static sourceReactor3D.groundMaterialNames(mapData)
Every material the ground types name, once each.
groundTypesHeaderGLSL
static sourceReactor3D.groundTypesHeaderGLSL(g)
The shader's declarations for a scene's ground types (groundSlopeMaterial splices them in).
groundTypesBodyGLSL
static sourceReactor3D.groundTypesBodyGLSL(g)
The types laid over the floor, in their order.
Details
The types laid over the floor, in their order. A texel of paint is a cell, read between cells, so a border is soft; it is then drawn in with a wandering edge, and a half-strength paint reads as patches, not as a wash. A type's image is laid from above and, where the ground leans, from the sides, as the floor itself is. Its tint and repeat (row 0 of rrGroundInfo), whether its picture is in and which layer it is (row 1) and its maps' settings (row 2) are read only where it is painted.
groundTypesUniforms
static sourceReactor3D.groundTypesUniforms(shader, g)
A ground's uniforms on a compiled floor shader.
lineSolid
static sourceReactor3D.lineSolid(place, x0, y0, v0, x1, y1, v1, code, a, b)
One solid as a line meets it: the frame that place maps the box (x0, y0, v0)-(x1, y1, v1) into, and how the solid fills that frame (code, with its own two numbers).
Details
One solid as a line meets it: the frame that place maps the box (x0, y0, v0)-(x1, y1, v1) into,
and how the solid fills that frame (code, with its own two numbers). Kept as the rows that carry
a world point into the frame, so a test is three products and no object.
lineInside
static sourceReactor3D.lineInside(s, u, y, v)
Whether a point of a solid's frame is in the solid.
lineEnters
static sourceReactor3D.lineEnters(s, ox, oy, oz, dx, dy, dz, t0, t1)
Where a line, between t0 and t1 along it, enters a solid; -1 when it does not.
lineIndex
static sourceReactor3D.lineIndex(mapData)
What lines are tested against on a map: its shapes by the cells their boxes reach, and each cell's solids as lines come to them.
lineCellPiece
static sourceReactor3D.lineCellPiece(mapData, piece, stack, list)
The solids of one cell piece, added to list.
lineCell
static sourceReactor3D.lineCell(index, mapData, x, y)
The solids on a cell (null when it has none), built the first time a line comes to it.
worldRay
static sourceReactor3D.worldRay(mapData, ox, oy, oz, dx, dy, dz, far, sight, level)
How far along a line the world lets it go, at most far: from (ox, oy, oz) along the unit direction (dx, dy, dz), in tiles, y up.
Details
How far along a line the world lets it go, at most far: from (ox, oy, oz) along the unit direction
(dx, dy, dz), in tiles, y up. Stopped by the ground, by a piece or shape where it is solid, by a shut
door and by the map's border; sight passes what is seen through (glass). Reactor3D.lineMet says what stopped it.
level: a line drawn on a flat picture of the map (an aim taken on the ground from above, which has no
height of its own). It keeps its height over the ground it passes: the ground never stops it, and what is
built is met at that height over its own cell's ground, so a wall stops it up a slope as on the level and a
counter lower than the weapon does not.
worldSolidAt
static sourceReactor3D.worldSolidAt(mapData, wx, wy, wz, sight, walker)
Whether a world point is in the ground or in a solid part of what is built.
Details
Whether a world point is in the ground or in a solid part of what is built. sight passes glass;
walker passes every door (whether a door lets a body by is the walking rule's to say).