跳转到内容

FieldSource

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

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

An area’s ground: a field of heights (0 to 1 over range, from 0 to height by default), centred on the terrain, with its splatmap and where its rain ran.

new FieldSource(field, data, splat, flow, range?, splat2?): FieldSource

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

Heightfield

Pick<TerrainData, "sizeX" | "sizeZ" | "height" | "rockSlope" | "dirtHeight" | "snowHeight">

Splat | null

Float32Array<ArrayBufferLike> | null

readonly [number, number] = ...

Splat | null = null

FieldSource

readonly bounds: readonly [number, number, number, number]

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

The area the ground covers, [minX, minZ, maxX, maxZ] in the terrain’s space; null for an infinite one.

TerrainSource.bounds


readonly field: Heightfield

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


readonly infinite: false = false

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

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

TerrainSource.infinite


readonly maxHeight: number

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

TerrainSource.maxHeight


readonly minHeight: number

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

The least and the most the height can be: what the pages encode their heights over.

TerrainSource.minHeight

ensureSplats(second): object

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

The splatmaps a brush paints into, made where the ground had none: the first from the paint the ground has now (by height and slope), the second (layers 5 to 8) empty, and only when second says it is wanted. They are as fine as the field, to 1024 a side.

boolean

object

a: Splat

b: Splat | null


height(x, z): number | null

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

The height at (x, z), or null off the area (or where a provider has not answered yet).

number

number

number | null

TerrainSource.height


normal(x, z): [number, number, number] | null

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

The ground’s normal at (x, z), or null off the area.

number

number

[number, number, number] | null

TerrainSource.normal


paint(x, z, h, ny): LayerWeights

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

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

TerrainSource.paint


splats(): object

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

The splatmaps now, null where the ground has none.

object

a: Splat | null

b: Splat | null


toData(): FieldSourceData

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

The ground as data (its arrays are shared, not copied): FieldSource.fromData makes the same ground from it.

FieldSourceData


static fromData(d): FieldSource

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

FieldSourceData

FieldSource