Namespace in reactor_3d_foliage.js

R

22 functions in 2 groups · hide internal

Oaks, cherry blossoms and willows that sway in the wind.

Quick Reference

Checks (True / False) 1

hasFoliage() Whether it has the foliage.

Other 21

decodeFoliageDensity() Density runs to levels: one byte per cell, size of them.
encodeFoliageDensity() Levels to runs, the trailing none left off.
normalizeFoliageLayer() Normalize foliage layer.
normalizeBush() Normalize bush.
normalizeWind() Normalize wind.
normalizeFoliage() Normalize foliage.
foliageOf() The map's foliage, normalized once per sidecar object (an edit writes a new one).
foliageCellOpen() Whether a kind may grow in a cell: not where a piece or a rock stands on the ground, not under water (reeds t…
pieceOnGround() Whether a piece or a rock stands on the ground in a cell (its foot under 1.5): nothing grows there.
foliageSlopeLimit() The steepest ground anything grows on (rise per tile): a little short of where the room draws rock.
foliageClumps() One layer's clumps in a square of cells, sorted by rank (drawing the first n is an even thinning): base (x, g…
bushCells() The cells a bush stops a walker in: its middle cell and those its body covers, when it is big enough.
bushBlocking() Bush blocking.
bushBlocksCell() Bush blocks cell.
terrainBlocks() Terrain blocks.
bushMesh() A bush as leaf cards round a woody core: positions (tiles), leaf-atlas UVs, colours, and per vertex the bush'…
foliageUniforms() Foliage uniforms.
foliageTemplate() A kind's clump, built in the shader from these: (side or u, height share t or v, which blade) and the part (0…
foliageMaterial() place is the scene's own wind and pushers (foliageOwn); without one the shared ones are read.
leafAtlas() Leaf clusters on a transparent sheet, three cells of it, and a solid corner for the stems.
bushMaterial() Bush material.

Checks (True / False)

hasFoliage

static source
R.hasFoliage(mapData)

Whether it has the foliage.

Other

decodeFoliageDensity

static source
R.decodeFoliageDensity(text, size)

Density runs to levels: one byte per cell, size of them.

Details

Density runs to levels: one byte per cell, size of them. Unknown tokens read as none.

encodeFoliageDensity

static source
R.encodeFoliageDensity(levels)

Levels to runs, the trailing none left off.

normalizeFoliageLayer

static source
R.normalizeFoliageLayer(raw, mapData)

Normalize foliage layer.

normalizeBush

static source
R.normalizeBush(raw, mapData)

Normalize bush.

normalizeWind

static source
R.normalizeWind(raw)

Normalize wind.

normalizeFoliage

static source
R.normalizeFoliage(raw, mapData)

Normalize foliage.

foliageOf

static source
R.foliageOf(mapData)

The map's foliage, normalized once per sidecar object (an edit writes a new one).

foliageCellOpen

static source
R.foliageCellOpen(mapData, x, y, kind, limit = R.foliageSlopeLimit(mapData)

Whether a kind may grow in a cell: not where a piece or a rock stands on the ground, not under water (reeds take shallow water), not on a slope the room draws as rock.

Details

Whether a kind may grow in a cell: not where a piece or a rock stands on the ground, not under water (reeds take shallow water), not on a slope the room draws as rock. Returns the water's depth for reeds (0 on land), or -1.

pieceOnGround

static source
R.pieceOnGround(mapData, x, y)

Whether a piece or a rock stands on the ground in a cell (its foot under 1.5): nothing grows there.

foliageSlopeLimit

static source
R.foliageSlopeLimit(mapData)

The steepest ground anything grows on (rise per tile): a little short of where the room draws rock.

foliageClumps

static source
R.foliageClumps(mapData, layer, x0, y0, x1, y1)

One layer's clumps in a square of cells, sorted by rank (drawing the first n is an even thinning): base (x, ground, z, yaw), shape (height, width, lean, rank) and tint (r, g, b, phase) per clump.

bushCells

static source
R.bushCells(bush)

The cells a bush stops a walker in: its middle cell and those its body covers, when it is big enough.

bushBlocking

static source
R.bushBlocking(mapData)

Bush blocking.

bushBlocksCell

static source
R.bushBlocksCell(mapData, x, y)

Bush blocks cell.

terrainBlocks

static source
R.terrainBlocks(mapData, x, y, x2, y2, near)

Terrain blocks.

bushMesh

static source
R.bushMesh(mapData, bush, out)

A bush as leaf cards round a woody core: positions (tiles), leaf-atlas UVs, colours, and per vertex the bush's foot and how much the vertex sways.

Details

A bush as leaf cards round a woody core: positions (tiles), leaf-atlas UVs, colours, and per vertex the bush's foot and how much the vertex sways. Seeded by the bush, so it looks the same each time the map loads.

foliageUniforms

static source
R.foliageUniforms()

Foliage uniforms.

foliageTemplate

static source
R.foliageTemplate(kind)

A kind's clump, built in the shader from these: (side or u, height share t or v, which blade) and the part (0 blade, 1 flower head, 2 cattail, 3 bulb).

foliageMaterial

static source
R.foliageMaterial(layer, place)

place is the scene's own wind and pushers (foliageOwn); without one the shared ones are read.

leafAtlas

static source
R.leafAtlas()

Leaf clusters on a transparent sheet, three cells of it, and a solid corner for the stems.

bushMaterial

static source
R.bushMaterial(place)

Bush material.