TerrainSource
Defined in: sdk/src/terrain/source.ts:21
The ground a terrain draws, as the pages and the CPU read it.
Properties
Section titled “Properties”bounds
Section titled “bounds”
readonlybounds: readonly [number,number,number,number] |null
Defined in: sdk/src/terrain/source.ts:25
The area the ground covers, [minX, minZ, maxX, maxZ] in the terrain’s space; null for an infinite one.
infinite
Section titled “infinite”
readonlyinfinite:boolean
Defined in: sdk/src/terrain/source.ts:23
Whether the ground goes on for ever (no edge to clip, no area to bake).
maxHeight
Section titled “maxHeight”
readonlymaxHeight:number
Defined in: sdk/src/terrain/source.ts:28
minHeight
Section titled “minHeight”
readonlyminHeight:number
Defined in: sdk/src/terrain/source.ts:27
The least and the most the height can be: what the pages encode their heights over.
Methods
Section titled “Methods”height()
Section titled “height()”height(
x,z):number|null
Defined in: sdk/src/terrain/source.ts:30
The height at (x, z), or null off the area (or where a provider has not answered yet).
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”number | null
normal()
Section titled “normal()”normal(
x,z): [number,number,number] |null
Defined in: sdk/src/terrain/source.ts:32
The ground’s unit normal at (x, z), or null where the height is not known.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”[number, number, number] | null
paint()
Section titled “paint()”paint(
x,z,h,ny):LayerWeights
Defined in: sdk/src/terrain/source.ts:34
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.
Parameters
Section titled “Parameters”number
number
number
number
Returns
Section titled “Returns”region()?
Section titled “region()?”
optionalregion(x0,z0,spacing,count):TerrainRegionSamples|Promise<TerrainRegionSamples>
Defined in: sdk/src/terrain/source.ts:39
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.
Parameters
Section titled “Parameters”number
number
spacing
Section titled “spacing”number
number
Returns
Section titled “Returns”TerrainRegionSamples | Promise<TerrainRegionSamples>