Namespace in reactor_3d_foliage.js

R.MapScene

12 public functions in 3 groups · show internal (_) functions

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

Quick Reference

Actions 4

addFoliage() Lay the map's foliage: every chunk at once in the editor (it draws only on a change), and in the game those n…
removeFoliage() Take away foliage meshes: those of keys chunks, or all.
disposeFoliageMaterials() Dispose foliage materials.
clear() Clear.

Updating & Drawing 2

updateFoliage() Lay foliage again after an edit: the chunks a region of cells touches, or all of it.
updateFoliageFrame() A few queued chunks a frame (game), within a small time budget; whoever walks through bends the grass.

Other 6

foliageOwn() A scene's own wind and pressed grass.
foliageGroup() Foliage group.
foliageChunkMesh() One chunk of one layer, as an instanced mesh; null when nothing grows there.
bushChunkMesh() The bushes standing in one chunk, merged; null when there are none.
siftFoliage() A world past the border: its queued chunks parted into those within reach of the eye (_foliageQueue, laid a f…
layFoliageChunk() Lay foliage chunk.

Actions

addFoliage

method source
R.MapScene.prototype.addFoliage(mapData, keys)

Lay the map's foliage: every chunk at once in the editor (it draws only on a change), and in the game those near the player at once and the rest a few a frame (updateFoliage drains the queue).

Details

Lay the map's foliage: every chunk at once in the editor (it draws only on a change), and in the game those near the player at once and the rest a few a frame (updateFoliage drains the queue). keys limits the work to some chunks (an edit), their old meshes taken away first.

removeFoliage

method source
R.MapScene.prototype.removeFoliage(keys)

Take away foliage meshes: those of keys chunks, or all.

disposeFoliageMaterials

method source
R.MapScene.prototype.disposeFoliageMaterials()

Dispose foliage materials.

clear

method source
R.MapScene.prototype.clear()

Clear.

Updating & Drawing

updateFoliage

method source
R.MapScene.prototype.updateFoliage(mapData, region)

Lay foliage again after an edit: the chunks a region of cells touches, or all of it.

updateFoliageFrame

method source
R.MapScene.prototype.updateFoliageFrame(characters, background)

A few queued chunks a frame (game), within a small time budget; whoever walks through bends the grass.

Details

A few queued chunks a frame (game), within a small time budget; whoever walks through bends the grass. background: a world past the map's border, which lays only the chunks within reach of the eye (siftFoliage).

Other

foliageOwn

method source
R.MapScene.prototype.foliageOwn()

A scene's own wind and pressed grass.

Details

A scene's own wind and pressed grass. A neighboring map's world stands beside the played one with its own wind, and its blades read walkers in its own tiles: shared, the last map laid set the wind for all of them and the neighbor's grass was pressed a whole map away from anyone. The clock, the eye and the thinning stay shared (beforeChunk sets them per group).

foliageGroup

method source
R.MapScene.prototype.foliageGroup()

Foliage group.

foliageChunkMesh

method source
R.MapScene.prototype.foliageChunkMesh(mapData, layer, index, cx, cy)

One chunk of one layer, as an instanced mesh; null when nothing grows there.

bushChunkMesh

method source
R.MapScene.prototype.bushChunkMesh(mapData, bushes, cx, cy)

The bushes standing in one chunk, merged; null when there are none.

siftFoliage

method source
R.MapScene.prototype.siftFoliage()

A world past the border: its queued chunks parted into those within reach of the eye (_foliageQueue, laid a few a frame) and those beyond it (_foliageFar, kept for when the eye nears).

Details

A world past the border: its queued chunks parted into those within reach of the eye (_foliageQueue, laid a few a frame) and those beyond it (_foliageFar, kept for when the eye nears). The batches wait only for the first (Reactor3D.DrawBatches reads _foliageQueue).

layFoliageChunk

method source
R.MapScene.prototype.layFoliageChunk(mapData, foliage, cx, cy)

Lay foliage chunk.