TiledSource
Defined in: sdk/src/terrain/tiles.ts:72
An area’s ground read from tiles.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TiledSource(
doc,params,overview,overviewSplat,overviewSplat2,read,budget?):TiledSource
Defined in: sdk/src/terrain/tiles.ts:90
Parameters
Section titled “Parameters”params
Section titled “params”Params
overview
Section titled “overview”overviewSplat
Section titled “overviewSplat”Splat | null
overviewSplat2
Section titled “overviewSplat2”Splat | null
(path) => Promise<TerrainImage | null>
budget?
Section titled “budget?”number = TERRAIN_TILE_BUDGET
Returns
Section titled “Returns”TiledSource
Properties
Section titled “Properties”bounds
Section titled “bounds”
readonlybounds: readonly [number,number,number,number]
Defined in: sdk/src/terrain/tiles.ts:74
The area the ground covers, [minX, minZ, maxX, maxZ] in the terrain’s space; null for an infinite one.
Implementation of
Section titled “Implementation of”budget
Section titled “budget”
readonlybudget:number=TERRAIN_TILE_BUDGET
Defined in: sdk/src/terrain/tiles.ts:97
readonlydoc:TerrainTilesDocument
Defined in: sdk/src/terrain/tiles.ts:91
infinite
Section titled “infinite”
readonlyinfinite:false=false
Defined in: sdk/src/terrain/tiles.ts:73
Whether the ground goes on for ever (no edge to clip, no area to bake).
Implementation of
Section titled “Implementation of”maxHeight
Section titled “maxHeight”
readonlymaxHeight:number
Defined in: sdk/src/terrain/tiles.ts:76
Implementation of
Section titled “Implementation of”minHeight
Section titled “minHeight”
readonlyminHeight:0=0
Defined in: sdk/src/terrain/tiles.ts:75
The least and the most the height can be: what the pages encode their heights over.
Implementation of
Section titled “Implementation of”overview
Section titled “overview”
readonlyoverview:Heightfield
Defined in: sdk/src/terrain/tiles.ts:93
samplesX
Section titled “samplesX”
readonlysamplesX:number
Defined in: sdk/src/terrain/tiles.ts:78
Samples along the whole area’s sides.
samplesZ
Section titled “samplesZ”
readonlysamplesZ:number
Defined in: sdk/src/terrain/tiles.ts:79
Accessors
Section titled “Accessors”overviewBytes
Section titled “overviewBytes”Get Signature
Section titled “Get Signature”get overviewBytes():
number
Defined in: sdk/src/terrain/tiles.ts:111
Bytes the overview holds, which stay for as long as the ground does.
Returns
Section titled “Returns”number
overviewSpacing
Section titled “overviewSpacing”Get Signature
Section titled “Get Signature”get overviewSpacing():
number
Defined in: sdk/src/terrain/tiles.ts:116
The world-unit spacing of the overview’s samples along x: pages this coarse or coarser are made from it alone.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”height()
Section titled “height()”height(
x,z):number|null
Defined in: sdk/src/terrain/tiles.ts:120
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
Implementation of
Section titled “Implementation of”normal()
Section titled “normal()”normal(
x,z): [number,number,number] |null
Defined in: sdk/src/terrain/tiles.ts:129
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
Implementation of
Section titled “Implementation of”paint()
Section titled “paint()”paint(
x,z,h,ny):LayerWeights
Defined in: sdk/src/terrain/tiles.ts:137
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”Implementation of
Section titled “Implementation of”region()
Section titled “region()”region(
x0,z0,spacing,count):TerrainRegionSamples|Promise<TerrainRegionSamples>
Defined in: sdk/src/terrain/tiles.ts:145
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>
Implementation of
Section titled “Implementation of”stats()
Section titled “stats()”stats():
TerrainTileStats
Defined in: sdk/src/terrain/tiles.ts:106
Returns
Section titled “Returns”trim()
Section titled “trim()”trim(
keep?):void
Defined in: sdk/src/terrain/tiles.ts:159
Lets go of tiles, least recently used first, until what is held is within the budget; those in keep stay.
Parameters
Section titled “Parameters”ReadonlySet<string> = ...
Returns
Section titled “Returns”void