Skip to content

ModifiedSource

Defined in: sdk/src/terrain/source.ts:290

A source with the modifiers laid over it: what the pages, the queries and collision all read.

new ModifiedSource(base, modifiers, origin, step): ModifiedSource

Defined in: sdk/src/terrain/source.ts:298

TerrainSource

() => Iterable<TerrainModifier>

number

number

number

number

ModifiedSource

readonly base: TerrainSource

Defined in: sdk/src/terrain/source.ts:298


readonly bounds: readonly [number, number, number, number] | null

Defined in: sdk/src/terrain/source.ts:292

The area the ground covers, [minX, minZ, maxX, maxZ] in the terrain’s space; null for an infinite one.

TerrainSource.bounds


readonly infinite: boolean

Defined in: sdk/src/terrain/source.ts:291

Whether the ground goes on for ever (no edge to clip, no area to bake).

TerrainSource.infinite


readonly maxHeight: number

Defined in: sdk/src/terrain/source.ts:294

TerrainSource.maxHeight


readonly minHeight: number

Defined in: sdk/src/terrain/source.ts:293

The least and the most the height can be: what the pages encode their heights over.

TerrainSource.minHeight


origin: object

Defined in: sdk/src/terrain/source.ts:296

The terrain’s world position: its space is this far from the world’s. Kept current by the terrain.

x: number

y: number

z: number

get region(): ((x0, z0, spacing, count) => TerrainRegionSamples | Promise<TerrainRegionSamples>) | undefined

Defined in: sdk/src/terrain/source.ts:325

The ground over a grid of count by count samples spacing apart from (x0, z0), when the source samples whole regions (a provider, which may answer later); without it the pages read height and paint point by point.

(x0, z0, spacing, count) => TerrainRegionSamples | Promise<TerrainRegionSamples>

The ground over a grid of count by count samples spacing apart from (x0, z0), when the source samples whole regions (a provider, which may answer later); without it the pages read height and paint point by point.

number

number

number

number

TerrainRegionSamples | Promise<TerrainRegionSamples>


undefined

TerrainSource.region

height(x, z): number | null

Defined in: sdk/src/terrain/source.ts:307

The height at (x, z), or null off the area (or where a provider has not answered yet).

number

number

number | null

TerrainSource.height


normal(x, z): [number, number, number] | null

Defined in: sdk/src/terrain/source.ts:312

The ground’s unit normal at (x, z), or null where the height is not known.

number

number

[number, number, number] | null

TerrainSource.normal


paint(x, z, h, ny): LayerWeights

Defined in: sdk/src/terrain/source.ts:321

The weights of the layers (up to eight; the first four by default grass, dirt, snow, rock) at (x, z), where the ground there is h high and faces ny up.

number

number

number

number

LayerWeights

TerrainSource.paint


touched(x0, z0, x1, z1): boolean

Defined in: sdk/src/terrain/source.ts:343

Whether any modifier can change something in the square [x0, x1] by [z0, z1] of the terrain’s space.

number

number

number

number

boolean