Skip to content

VoxelTerrains

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

What a game asks of its volumes. Places are in the world.

new VoxelTerrains(): VoxelTerrains

VoxelTerrains

carve(entity, shape, options?): VoxelEditResult | null

Defined in: sdk/src/voxel/voxelPlugin.ts:223

Carves a shape out of the volume. What it answers is how much of each material came out.

number

VoxelShape

VoxelEditOptions

VoxelEditResult | null


collisionReadyAt(entity, x, z): boolean

Defined in: sdk/src/voxel/voxelPlugin.ts:282

Whether the volume round (x, z) is built for collision: what a game waits on before it drops something there.

number

number

number

boolean


distanceAt(entity, at): number | null

Defined in: sdk/src/voxel/voxelPlugin.ts:250

The signed distance at a place: below zero is inside something solid. Null with no such volume.

number

VoxelPoint

number | null


edit(entity, shape, op, options?): VoxelEditResult | null

Defined in: sdk/src/voxel/voxelPlugin.ts:212

Changes the volume with a shape. Every chunk the shape reaches is made again, and the collision with it.

number

VoxelShape

VoxelOp

VoxelEditOptions

VoxelEditResult | null


fill(entity, shape, material?, options?): VoxelEditResult | null

Defined in: sdk/src/voxel/voxelPlugin.ts:228

Fills a shape with a material.

number

VoxelShape

number = 0

VoxelEditOptions

VoxelEditResult | null


materialAt(entity, at): number | null

Defined in: sdk/src/voxel/voxelPlugin.ts:258

The material at a place, or -1 in the open. Null with no such volume.

number

VoxelPoint

number | null


onEdit(listener): () => void

Defined in: sdk/src/voxel/voxelPlugin.ts:233

Hears every edit that changed something: what a game keeps a navmesh or a quest in step by. Returns how to stop.

(event) => void

() => void


raycast(origin, direction, maxDistance?): VoxelHit & object | null

Defined in: sdk/src/voxel/voxelPlugin.ts:239

Where a ray first meets any volume, within maxDistance.

VoxelPoint

VoxelPoint

number = 1000

VoxelHit & object | null


restore(entity, data, merge?): boolean

Defined in: sdk/src/voxel/voxelPlugin.ts:271

Puts a save back; with merge, over what is there rather than instead of it. False when it was cut from another grid and nothing changed.

number

VoxelFieldData

boolean = false

boolean


serialize(entity, changedOnly?): VoxelFieldData | null

Defined in: sdk/src/voxel/voxelPlugin.ts:266

What a save holds: only chunks that were edited, and with changedOnly only those changed since the last such call. Plain JSON.

number

boolean = false

VoxelFieldData | null


setSource(entity, source): void

Defined in: sdk/src/voxel/voxelPlugin.ts:199

Sets what the volume is before anyone digs in it, in place of the stock hills. The same place must always get the same answer.

number

VoxelSource | null

void


status(entity): VoxelTerrainStatus | null

Defined in: sdk/src/voxel/voxelPlugin.ts:289

number

VoxelTerrainStatus | null