Skip to content

API reference / @jsprismarine/native-worldgen / NativeWorldgen / NativeCellProgram

Class: NativeCellProgram ​

Defined in: NativeWorldgen.ts:664

A cell program in native memory, made by NativeWorldgen.createCellProgram.

Properties ​

cornerCount ​

readonly cornerCount: number

Defined in: NativeWorldgen.ts:668

How many corner values a fill reads: eight per interpolated cell.


size ​

readonly size: number

Defined in: NativeWorldgen.ts:670

How many values a fill writes: one per block of the cell.

Methods ​

destroy() ​

destroy(): void

Defined in: NativeWorldgen.ts:707

Frees the program's native memory. Later calls throw.

Returns ​

void


fill() ​

fill(corners, out): void

Defined in: NativeWorldgen.ts:693

Fills out with the tree's value at every block of one cell, x-major, then z, then y. Hook records take their neutral constant, so call it only for a context with no hook set.

Parameters ​

corners ​

Float64Array

cornerCount values: each interpolated cell's eight corners in turn.

out ​

Float64Array

At least size values.

Returns ​

void

Throws ​

After destroy.

Throws ​

When a buffer is shorter than the fill.