跳转到内容

TerrainSource

此内容尚不支持你的语言。

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

The ground a terrain draws, as the pages and the CPU read it.

readonly bounds: 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.


readonly infinite: boolean

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

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


readonly maxHeight: number

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


readonly minHeight: 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.

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).

number

number

number | null


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.

number

number

[number, number, number] | null


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.

number

number

number

number

LayerWeights


optional region(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.

number

number

number

number

TerrainRegionSamples | Promise<TerrainRegionSamples>