跳转到内容

VoxelField

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

Defined in: sdk/src/voxel/field.ts:190

new VoxelField(options): VoxelField

Defined in: sdk/src/voxel/field.ts:207

VoxelFieldOptions

VoxelField

readonly cellSize: number

Defined in: sdk/src/voxel/field.ts:191


readonly chunkCells: number

Defined in: sdk/src/voxel/field.ts:192


readonly rowMax: number

Defined in: sdk/src/voxel/field.ts:195


readonly rowMin: number

Defined in: sdk/src/voxel/field.ts:194


readonly side: number

Defined in: sdk/src/voxel/field.ts:193

get held(): object

Defined in: sdk/src/voxel/field.ts:473

How many chunks are held with their samples, and how many of those were edited.

object

chunks: number

edited: number

apply(shape, op, options?): VoxelEditResult

Defined in: sdk/src/voxel/field.ts:279

Carves, fills or paints with a shape. Everything it reaches, the margins of the chunks round it included, changes together.

VoxelShape

VoxelOp

VoxelEditOptions = {}

VoxelEditResult


chunk(cx, cy, cz): VoxelChunk

Defined in: sdk/src/voxel/field.ts:222

The chunk, holding its samples. Asks the source when nothing holds them.

number

number

number

VoxelChunk


distanceAt(x, y, z): number

Defined in: sdk/src/voxel/field.ts:360

The signed distance at a place, read between the samples.

number

number

number

number


materialAt(x, y, z): number

Defined in: sdk/src/voxel/field.ts:371

The material of the deepest solid sample round a place, or -1 where all round it is air.

number

number

number

number


raycast(origin, direction, maxDistance): VoxelHit | null

Defined in: sdk/src/voxel/field.ts:388

Where a ray from origin first meets something solid, within maxDistance. direction need not be of any length.

VoxelPoint

VoxelPoint

number

VoxelHit | null


restore(data, merge?, skipped?): boolean

Defined in: sdk/src/voxel/field.ts:438

Puts saved chunks back over the volume. With merge those not named stay as they are; otherwise they go back to the source. A save cut from another grid cannot be read and changes nothing: false. A chunk that cannot be read is left as it was, and named in skipped.

VoxelFieldData

boolean = false

string[]

boolean


serialize(changedOnly?): VoxelFieldData

Defined in: sdk/src/voxel/field.ts:421

What the save holds: every chunk edited, or only those changed since the last call that asked for changedOnly.

boolean = false

VoxelFieldData


takeDirty(): VoxelChunk[]

Defined in: sdk/src/voxel/field.ts:272

The chunks changed since this was last asked.

VoxelChunk[]


trim(keep?): void

Defined in: sdk/src/voxel/field.ts:262

Lets go of what the source can make again, oldest first, past the number to hold. What keep names stays and is not counted: asking the source again is what a dig must not wait on.

(chunk) => boolean

void