跳转到内容

NoiseSource

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

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

Ground that goes on for ever: fractal noise read at any point, frequency hills to every sizeX world units, height tall at most. erosion damps each octave by how steep the ones under it already are, which is what rain does to real ground.

new NoiseSource(p): NoiseSource

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

NoiseParams

NoiseSource

readonly bounds: null = null

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

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

TerrainSource.bounds


readonly infinite: true = true

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

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:177

TerrainSource.maxHeight


readonly minHeight: 0 = 0

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

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

TerrainSource.minHeight

height(x, z): number

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

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

number

number

number

TerrainSource.height


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

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

The normal at (x, z), from the noise’s own slope.

number

number

[number, number, number]

TerrainSource.normal


paint(_x, _z, h, ny): [number, number, number, number]

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

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

[number, number, number, number]

TerrainSource.paint


sample(x, z): [number, number, number]

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

The height (0 to 1) at (x, z) and its slope along x and z, per world unit.

number

number

[number, number, number]


toData(): NoiseParams

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

The ground as data: NoiseSource.fromData makes the same ground from it.

NoiseParams


static fromData(p): NoiseSource

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

NoiseParams

NoiseSource