Namespace in reactor_3d_surround.js

R

32 public functions in 2 groups · show internal (_) functions

The open road.

Quick Reference

Actions 1

clearCameraLevel() A camera on the player (looking at focus) in a map with a map over it stays under this map's top: over it sta…

Other 31

normalizeSurround() A map's surroundings as stored, checked; null when it has none (absent, or style none on every side).
levelTop() How tall a map is: what a map over it stands on.
levelRise() How far the lower map's ground lies under the upper map's height 0, in tiles: the lower map's height, the flo…
levelMiddle() The height, in this map's measure, at which someone passes into the map on side: with no opening, halfway bet…
levelBase() Level base.
normalizeLevels() Normalize levels.
levelOpening() The level whose opening a tile of this map lies in: for below, a tile with no ground of this map's own (what…
groundThroughLevel() Ground through level.
ladderThroughLevel() The ladder on a tile over an opening to the map under: that map's ladder there, its foot and its top in this…
levelFocus() The height a camera on the player looks at, for a player at elevation on tile (x, y): in an opening to the ma…
ownGroundAt() A map's own ground at a place, whatever opening is there: what is stood on nearest its bare ground (the groun…
levelsOf() Levels of.
levelExit() Where someone at height alt (tiles over the map's ground level) on tile (x, y) has gone: past the middle of t…
normalizeNeighbors() The maps past a border as stored, checked: only the sides that name a map, each { map } or { map, shift }.
neighborsOf() The maps past a map's border, by side; empty when it has none.
neighborExit() Where a step off the map from tile (x, y) in direction d leads: { mapId, side, along, d }, or null when the s…
neighborArrival() The tile someone who left by exit arrives on in a map width by height: on the border that faces the side left…
surroundOf() Surround of.
surroundStyleOf() The style past one side.
surroundPastNeighbors() A map's land past its border, with every side that names a neighboring map and is raised laid as land that go…
surroundNoise() -1..1, three octaves.
surroundRays() The rays the land runs out along: one from every border corner of every tile, straight out from its side, and…
surroundRings() Ring distances out to distance, close together at the border, and each ring's ray step.
surroundProfile() The border's height under every ray, and that profile smoothed ever wider (level l over 2^(l-1) rays each way…
surroundHeight() The land's height d tiles out along a ray, for one style.
surroundSeamHeight() Surround seam height.
surroundWetAt() The water standing at a border point: a sheet's level over the ground there, else null.
surroundGeometry() The surroundings as plain arrays: ground (positions, uvs, normals, fade 0-1 per vertex, index, and hazeIndex:…
surroundNormals() Smooth normals from the triangles (each weighted by its area).
surroundUnderside() A floating island's underside: from the border straight down a lip, then in under the map to a point, rough a…
surroundSeamStyles() For each corner a neighbor is named past (corner k lies between side k and the next), the raised style the li…

Actions

clearCameraLevel

static source
R.clearCameraLevel(camera, focus, mapData)

A camera on the player (looking at focus) in a map with a map over it stays under this map's top: over it stands the other map's ground, drawn through the openings, and a camera that rose past the ceiling with a climber sat in that map's grass.

Details

A camera on the player (looking at focus) in a map with a map over it stays under this map's top: over it stands the other map's ground, drawn through the openings, and a camera that rose past the ceiling with a climber sat in that map's grass. It is held at that height, where it stands, and looks at the player from there; the body is out of this map before its chest passes the opening (LEVEL_CROSS).

Other

normalizeSurround

static source
R.normalizeSurround(raw)

A map's surroundings as stored, checked; null when it has none (absent, or style none on every side).

levelTop

static source
R.levelTop(mapData)

How tall a map is: what a map over it stands on.

levelRise

static source
R.levelRise(mapData, side, level, other)

How far the lower map's ground lies under the upper map's height 0, in tiles: the lower map's height, the floor between them and the level's gap, less how high the upper map's ground is at the first opening (levelBase; negative on a hilltop is usual: the map under then lies inside the hill).

Details

How far the lower map's ground lies under the upper map's height 0, in tiles: the lower map's height, the floor between them and the level's gap, less how high the upper map's ground is at the first opening (levelBase; negative on a hilltop is usual: the map under then lies inside the hill). other is that map when the caller holds it; without it the map under is asked for (Neighbors.request), and the answer is null until it is read.

levelMiddle

static source
R.levelMiddle(mapData, side, level, other, outside)

The height, in this map's measure, at which someone passes into the map on side: with no opening, halfway between the two maps' grounds; through an opening, LEVEL_CROSS under the upper map's ground there.

Details

The height, in this map's measure, at which someone passes into the map on side: with no opening, halfway between the two maps' grounds; through an opening, LEVEL_CROSS under the upper map's ground there. Null while the other map is not read.

levelBase

static source
R.levelBase(upper, side, level)

Level base.

normalizeLevels

static source
R.normalizeLevels(raw)

Normalize levels.

levelOpening

static source
R.levelOpening(mapData, side, x, y)

The level whose opening a tile of this map lies in: for below, a tile with no ground of this map's own (what is stood on there is the map under: its floor, or the stair it sends up); for above, a tile with no ceiling.

Details

The level whose opening a tile of this map lies in: for below, a tile with no ground of this map's own (what is stood on there is the map under: its floor, or the stair it sends up); for above, a tile with no ceiling. Null elsewhere.

groundThroughLevel

static source
R.groundThroughLevel(mapData, wx, wz, near)

Ground through level.

ladderThroughLevel

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

The ladder on a tile over an opening to the map under: that map's ladder there, its foot and its top in this map's measure, so a climber that changes map on it (levelMiddle) is still on it in this map, and one that steps into the opening from this map's ground takes hold of it.

Details

The ladder on a tile over an opening to the map under: that map's ladder there, its foot and its top in this map's measure, so a climber that changes map on it (levelMiddle) is still on it in this map, and one that steps into the opening from this map's ground takes hold of it. Null where the map under has no ladder there (or is not read yet). through says whose ladder it is.

levelFocus

static source
R.levelFocus(mapData, x, y, elevation)

The height a camera on the player looks at, for a player at elevation on tile (x, y): in an opening to the map under and below this map's ground there (on a ladder or a stair that comes up through it, or falling in), the ground at the opening, so the camera stays over the opening and looks into it.

Details

The height a camera on the player looks at, for a player at elevation on tile (x, y): in an opening to the map under and below this map's ground there (on a ladder or a stair that comes up through it, or falling in), the ground at the opening, so the camera stays over the opening and looks into it. It followed the body down into ground it cannot stand in, and came in until it was inside the body.

ownGroundAt

static source
R.ownGroundAt(mapData, x, z)

A map's own ground at a place, whatever opening is there: what is stood on nearest its bare ground (the ground itself, a floor or a slab laid on it), as groundHeightAt answers with no map under it.

levelsOf

static source
R.levelsOf(mapData)

Levels of.

levelExit

static source
R.levelExit(mapData, x, y, alt)

Where someone at height alt (tiles over the map's ground level) on tile (x, y) has gone: past the middle of the gap to the map under or over this one.

Details

Where someone at height alt (tiles over the map's ground level) on tile (x, y) has gone: past the middle of the gap to the map under or over this one. { side, mapId, x, y, rise }: the tile in that map's own tiles and what to add to a height to have it in that map's; null while still in this map.

normalizeNeighbors

static source
R.normalizeNeighbors(raw)

The maps past a border as stored, checked: only the sides that name a map, each { map } or { map, shift }.

neighborsOf

static source
R.neighborsOf(mapData)

The maps past a map's border, by side; empty when it has none.

neighborExit

static source
R.neighborExit(mapData, x, y, d, reach = 0)

Where a step off the map from tile (x, y) in direction d leads: { mapId, side, along, d }, or null when the step stays on the map or no map lies past that side.

Details

Where a step off the map from tile (x, y) in direction d leads: { mapId, side, along, d }, or null when the step stays on the map or no map lies past that side. along is the tile along the shared border, counted in the neighbor's own tiles. reach is how many tiles from the border the step may start (a vehicle's nose meets the border before its middle does).

neighborArrival

static source
R.neighborArrival(exit, width, height, standable)

The tile someone who left by exit arrives on in a map width by height: on the border that faces the side left (inset tiles in from it: a vehicle arrives whole), at along held to the border's length, or the nearest tile along the border that standable(x, y) accepts (the plain tile when none is).

Details

The tile someone who left by exit arrives on in a map width by height: on the border that faces the side left (inset tiles in from it: a vehicle arrives whole), at along held to the border's length, or the nearest tile along the border that standable(x, y) accepts (the plain tile when none is).

surroundOf

static source
R.surroundOf(mapData)

Surround of.

surroundStyleOf

static source
R.surroundStyleOf(surround, side)

The style past one side.

surroundPastNeighbors

static source
R.surroundPastNeighbors(surround, none)

A map's land past its border, with every side that names a neighboring map and is raised laid as land that goes on ("continue"): what is drawn there while that map's own world does not stand (none: the sides where it does, which have no land at all).

Details

A map's land past its border, with every side that names a neighboring map and is raised laid as land that goes on ("continue"): what is drawn there while that map's own world does not stand (none: the sides where it does, which have no land at all). The same object back when nothing changes.

surroundNoise

static source
R.surroundNoise(x, y, seed)

-1..1, three octaves.

surroundRays

static source
R.surroundRays(W, H, fan = R.SURROUND_FAN)

The rays the land runs out along: one from every border corner of every tile, straight out from its side, and a fan of them round each corner of the map.

Details

The rays the land runs out along: one from every border corner of every tile, straight out from its side, and a fan of them round each corner of the map. keep is the coarsest ring a ray is still part of (a power of two: far rings keep every second, fourth, ... ray of a side).

surroundRings

static source
R.surroundRings(distance, steep = false)

Ring distances out to distance, close together at the border, and each ring's ray step.

surroundProfile

static source
R.surroundProfile(heights)

The border's height under every ray, and that profile smoothed ever wider (level l over 2^(l-1) rays each way).

surroundHeight

static source
R.surroundHeight(style, s, c)

The land's height d tiles out along a ray, for one style.

Details

The land's height d tiles out along a ray, for one style. c carries what the ray knows: h0 the border's height there, hC that height carried out (smoothed with distance), slope the ground's lean across the border, x, z the point, D the reach, and the map's mean/low.

surroundSeamHeight

static source
R.surroundSeamHeight(corner, x, z, d, style)

Surround seam height.

surroundWetAt

static source
R.surroundWetAt(mapData, ray, ground)

The water standing at a border point: a sheet's level over the ground there, else null.

surroundGeometry

static source
R.surroundGeometry(mapData, surround, options = {})

The surroundings as plain arrays: ground (positions, uvs, normals, fade 0-1 per vertex, index, and hazeIndex: the triangles the fade reaches), water (positions, uvs, depth, edge, index) or null, and info.

Details

The surroundings as plain arrays: ground (positions, uvs, normals, fade 0-1 per vertex, index, and hazeIndex: the triangles the fade reaches), water (positions, uvs, depth, edge, index) or null, and info. floorY is the height the room floor lies at before the terrain lifts it.

surroundNormals

static source
R.surroundNormals(positions, index)

Smooth normals from the triangles (each weighted by its area).

surroundUnderside

static source
R.surroundUnderside(mapData, surround, p)

A floating island's underside: from the border straight down a lip, then in under the map to a point, rough as rock.

Details

A floating island's underside: from the border straight down a lip, then in under the map to a point, rough as rock. Its faces look outward and down, so the floor's own material draws it as cliff.

surroundSeamStyles

static source
R.surroundSeamStyles(scene, surround)

For each corner a neighbor is named past (corner k lies between side k and the next), the raised style the line out from it climbs: when this map and the neighbor both raise the edge that runs on past the corner (cliffs, mountains), cliffs if both are cliffs, else mountains (the same answer from either map); else null.

Details

For each corner a neighbor is named past (corner k lies between side k and the next), the raised style the line out from it climbs: when this map and the neighbor both raise the edge that runs on past the corner (cliffs, mountains), cliffs if both are cliffs, else mountains (the same answer from either map); else null. A neighbor not read yet is waited for (_surroundSeamWait): its land is laid again once it is (N.seamsKnown).