VoxelField
此内容尚不支持你的语言。
Defined in: sdk/src/voxel/field.ts:190
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VoxelField(
options):VoxelField
Defined in: sdk/src/voxel/field.ts:207
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”VoxelField
Properties
Section titled “Properties”cellSize
Section titled “cellSize”
readonlycellSize:number
Defined in: sdk/src/voxel/field.ts:191
chunkCells
Section titled “chunkCells”
readonlychunkCells:number
Defined in: sdk/src/voxel/field.ts:192
rowMax
Section titled “rowMax”
readonlyrowMax:number
Defined in: sdk/src/voxel/field.ts:195
rowMin
Section titled “rowMin”
readonlyrowMin:number
Defined in: sdk/src/voxel/field.ts:194
readonlyside:number
Defined in: sdk/src/voxel/field.ts:193
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”object
chunks
Section titled “chunks”chunks:
number
edited
Section titled “edited”edited:
number
Methods
Section titled “Methods”apply()
Section titled “apply()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”VoxelEditOptions = {}
Returns
Section titled “Returns”chunk()
Section titled “chunk()”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.
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”VoxelChunk
distanceAt()
Section titled “distanceAt()”distanceAt(
x,y,z):number
Defined in: sdk/src/voxel/field.ts:360
The signed distance at a place, read between the samples.
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”number
materialAt()
Section titled “materialAt()”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.
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”number
raycast()
Section titled “raycast()”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.
Parameters
Section titled “Parameters”origin
Section titled “origin”direction
Section titled “direction”maxDistance
Section titled “maxDistance”number
Returns
Section titled “Returns”VoxelHit | null
restore()
Section titled “restore()”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.
Parameters
Section titled “Parameters”merge?
Section titled “merge?”boolean = false
skipped?
Section titled “skipped?”string[]
Returns
Section titled “Returns”boolean
serialize()
Section titled “serialize()”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.
Parameters
Section titled “Parameters”changedOnly?
Section titled “changedOnly?”boolean = false
Returns
Section titled “Returns”takeDirty()
Section titled “takeDirty()”takeDirty():
VoxelChunk[]
Defined in: sdk/src/voxel/field.ts:272
The chunks changed since this was last asked.
Returns
Section titled “Returns”VoxelChunk[]
trim()
Section titled “trim()”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.
Parameters
Section titled “Parameters”(chunk) => boolean
Returns
Section titled “Returns”void