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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NoiseSource(
p):NoiseSource
Defined in: sdk/src/terrain/source.ts:179
Parameters
Section titled “Parameters”Returns
Section titled “Returns”NoiseSource
Properties
Section titled “Properties”bounds
Section titled “bounds”
readonlybounds: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.
Implementation of
Section titled “Implementation of”infinite
Section titled “infinite”
readonlyinfinite: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).
Implementation of
Section titled “Implementation of”maxHeight
Section titled “maxHeight”
readonlymaxHeight:number
Defined in: sdk/src/terrain/source.ts:177
Implementation of
Section titled “Implementation of”minHeight
Section titled “minHeight”
readonlyminHeight: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.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”height()
Section titled “height()”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).
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”normal()
Section titled “normal()”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.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”[number, number, number]
Implementation of
Section titled “Implementation of”paint()
Section titled “paint()”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.
Parameters
Section titled “Parameters”number
number
number
number
Returns
Section titled “Returns”[number, number, number, number]
Implementation of
Section titled “Implementation of”sample()
Section titled “sample()”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.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”[number, number, number]
toData()
Section titled “toData()”toData():
NoiseParams
Defined in: sdk/src/terrain/source.ts:184
The ground as data: NoiseSource.fromData makes the same ground from it.
Returns
Section titled “Returns”fromData()
Section titled “fromData()”
staticfromData(p):NoiseSource
Defined in: sdk/src/terrain/source.ts:188
Parameters
Section titled “Parameters”Returns
Section titled “Returns”NoiseSource