API reference / @jsprismarine/native-worldgen / NativeWorldgen / NativeDensityProgram
Class: NativeDensityProgram
Defined in: NativeWorldgen.ts:614
A density program in native memory, made by NativeWorldgen.createProgram.
Properties
stacks
readonlystacks: readonlyNativeNoiseStack[]
Defined in: NativeWorldgen.ts:618
The stacks the program samples, held so they live as long as it does.
Accessors
nativeHandle
Get Signature
get nativeHandle():
number
Defined in: NativeWorldgen.ts:650
The program's handle, for native code that runs it. It stays valid until destroy, so keep this program alive while that code names it; 0 after.
Returns
number
Methods
destroy()
destroy():
void
Defined in: NativeWorldgen.ts:655
Frees the program's native memory. Later calls throw. Its stacks stay alive.
Returns
void
eval()
eval(
x,y,z):number
Defined in: NativeWorldgen.ts:641
The program's value at one position.
Parameters
x
number
y
number
z
number
Returns
number
Throws
After destroy.