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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ModifiedSource(
base,modifiers,origin,step):ModifiedSource
Defined in: sdk/src/terrain/source.ts:298
Parameters
Section titled “Parameters”modifiers
Section titled “modifiers”() => Iterable<TerrainModifier>
origin
Section titled “origin”number
number
number
number
Returns
Section titled “Returns”ModifiedSource
Properties
Section titled “Properties”
readonlybase:TerrainSource
Defined in: sdk/src/terrain/source.ts:298
bounds
Section titled “bounds”
readonlybounds: 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.
Implementation of
Section titled “Implementation of”infinite
Section titled “infinite”
readonlyinfinite:boolean
Defined in: sdk/src/terrain/source.ts:291
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/source.ts:294
Implementation of
Section titled “Implementation of”minHeight
Section titled “minHeight”
readonlyminHeight: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.
Implementation of
Section titled “Implementation of”origin
Section titled “origin”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
Accessors
Section titled “Accessors”region
Section titled “region”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Function
Section titled “Function”(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.
Parameters
Section titled “Parameters”number
number
spacing
Section titled “spacing”number
number
Returns
Section titled “Returns”TerrainRegionSamples | Promise<TerrainRegionSamples>
undefined
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”height()
Section titled “height()”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).
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/source.ts:312
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/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.
Parameters
Section titled “Parameters”number
number
number
number
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”touched()
Section titled “touched()”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.
Parameters
Section titled “Parameters”number
number
number
number
Returns
Section titled “Returns”boolean