API reference / @jsprismarine/native-worldgen / NativeWorldgen / NativeNoiseStack
Class: NativeNoiseStack
Defined in: NativeWorldgen.ts:555
An octave stack in native memory, made by NativeWorldgen.createStack.
Accessors
nativeHandle
Get Signature
get nativeHandle():
number
Defined in: NativeWorldgen.ts:600
The stack's handle, for a native program that samples it. It stays valid until destroy, so keep this stack alive while a program names it.
Returns
number
Methods
destroy()
destroy():
void
Defined in: NativeWorldgen.ts:605
Frees the stack's native memory. Later calls throw.
Returns
void
fill()
fill(
xyz,out):void
Defined in: NativeWorldgen.ts:587
Fills out[i] with the value at xyz[3i], xyz[3i + 1], xyz[3i + 2], in one call. The two may be views of the same memory.
Parameters
xyz
Float64Array
The positions, three coordinates each.
out
Float64Array
Where the values go; positions beyond its length are not sampled.
Returns
void
Throws
After destroy.
get3()
get3(
x,y,z):number
Defined in: NativeWorldgen.ts:575
The stack's value at one position.
Parameters
x
number
y
number
z
number
Returns
number
The sum of the octaves, rounded to single precision as NoiseStack.get3 rounds it.
Throws
After destroy.