VoxelTerrains
此内容尚不支持你的语言。
Defined in: sdk/src/voxel/voxelPlugin.ts:191
What a game asks of its volumes. Places are in the world.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VoxelTerrains():
VoxelTerrains
Returns
Section titled “Returns”VoxelTerrains
Methods
Section titled “Methods”carve()
Section titled “carve()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
options?
Section titled “options?”Returns
Section titled “Returns”VoxelEditResult | null
collisionReadyAt()
Section titled “collisionReadyAt()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
number
number
Returns
Section titled “Returns”boolean
distanceAt()
Section titled “distanceAt()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”number | null
edit()
Section titled “edit()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
options?
Section titled “options?”Returns
Section titled “Returns”VoxelEditResult | null
fill()
Section titled “fill()”fill(
entity,shape,material?,options?):VoxelEditResult|null
Defined in: sdk/src/voxel/voxelPlugin.ts:228
Fills a shape with a material.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
material?
Section titled “material?”number = 0
options?
Section titled “options?”Returns
Section titled “Returns”VoxelEditResult | null
materialAt()
Section titled “materialAt()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”number | null
onEdit()
Section titled “onEdit()”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.
Parameters
Section titled “Parameters”listener
Section titled “listener”(event) => void
Returns
Section titled “Returns”() => void
raycast()
Section titled “raycast()”raycast(
origin,direction,maxDistance?):VoxelHit&object|null
Defined in: sdk/src/voxel/voxelPlugin.ts:239
Where a ray first meets any volume, within maxDistance.
Parameters
Section titled “Parameters”origin
Section titled “origin”direction
Section titled “direction”maxDistance?
Section titled “maxDistance?”number = 1000
Returns
Section titled “Returns”VoxelHit & object | null
restore()
Section titled “restore()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
merge?
Section titled “merge?”boolean = false
Returns
Section titled “Returns”boolean
serialize()
Section titled “serialize()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
changedOnly?
Section titled “changedOnly?”boolean = false
Returns
Section titled “Returns”VoxelFieldData | null
setSource()
Section titled “setSource()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
source
Section titled “source”VoxelSource | null
Returns
Section titled “Returns”void
status()
Section titled “status()”status(
entity):VoxelTerrainStatus|null
Defined in: sdk/src/voxel/voxelPlugin.ts:289
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”VoxelTerrainStatus | null