Перейти к основному содержимому

Class: BlockVolume

An immutable inclusive cuboid of block positions. A volume from (0,0,0) to (0,0,0) contains one block.

Constructors

Constructor

new BlockVolume(from, to): BlockVolume

Creates an inclusive volume from two opposite corners.

Parameters

from

Vector3Like

to

Vector3Like

Returns

BlockVolume

Properties

from

readonly from: BlockVector3

Original first corner, converted to integer block coordinates.


to

readonly to: BlockVector3

Original opposite corner, converted to integer block coordinates.

Methods

getCapacity()

getCapacity(): number

Returns the inclusive volume in blocks.

Returns

number


getMax()

getMax(): BlockVector3

Returns the component-wise largest corner.

Returns

BlockVector3


getMin()

getMin(): BlockVector3

Returns the component-wise smallest corner.

Returns

BlockVector3


getSpan()

getSpan(): BlockVector3

Returns the inclusive number of blocks along each axis.

Returns

BlockVector3


isInside()

isInside(location): boolean

Returns whether a location falls inside the inclusive bounds.

Parameters

location

Vector3Like

Returns

boolean