ProviderSource
此内容尚不支持你的语言。
Defined in: sdk/src/terrain/provider.ts:84
Ground from a provider, as a terrain draws and answers it. Positions are world positions less the terrain’s own.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ProviderSource(
provider,world,seed,version,originX,originZ,pointSpacing,paintRules):ProviderSource
Defined in: sdk/src/terrain/provider.ts:92
Parameters
Section titled “Parameters”provider
Section titled “provider”string
number
version
Section titled “version”number
originX
Section titled “originX”number
The terrain’s own position, which the provider’s world positions are offset by.
originZ
Section titled “originZ”number
pointSpacing
Section titled “pointSpacing”number
The spacing a point’s tile is sampled at: the finest the terrain is drawn at.
paintRules
Section titled “paintRules”(h, ny) => [number, number, number, number]
Returns
Section titled “Returns”ProviderSource
Properties
Section titled “Properties”bounds
Section titled “bounds”
readonlybounds:null=null
Defined in: sdk/src/terrain/provider.ts:86
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”infinite
Section titled “infinite”
readonlyinfinite:true=true
Defined in: sdk/src/terrain/provider.ts:85
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/provider.ts:88
Implementation of
Section titled “Implementation of”minHeight
Section titled “minHeight”
readonlyminHeight:number
Defined in: sdk/src/terrain/provider.ts:87
The least and the most the height can be: what the pages encode their heights over.
Implementation of
Section titled “Implementation of”provider
Section titled “provider”
readonlyprovider:TerrainProvider
Defined in: sdk/src/terrain/provider.ts:93
readonlyseed:number
Defined in: sdk/src/terrain/provider.ts:95
version
Section titled “version”
readonlyversion:number
Defined in: sdk/src/terrain/provider.ts:96
readonlyworld:string
Defined in: sdk/src/terrain/provider.ts:94
Methods
Section titled “Methods”height()
Section titled “height()”height(
x,z):number|null
Defined in: sdk/src/terrain/provider.ts:115
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/provider.ts:137
The normal at (x, z), from the heights a spacing either side; null where they are not known yet.
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): [number,number,number,number]
Defined in: sdk/src/terrain/provider.ts:146
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”[number, number, number, number]
Implementation of
Section titled “Implementation of”region()
Section titled “region()”region(
x0,z0,spacing,count):TerrainSamples|Promise<TerrainSamples>
Defined in: sdk/src/terrain/provider.ts:111
The ground over a region of the terrain’s space, from the provider.
Parameters
Section titled “Parameters”number
number
spacing
Section titled “spacing”number
number
Returns
Section titled “Returns”TerrainSamples | Promise<TerrainSamples>