For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockBoundingBoxUtils.md.

Class: BlockBoundingBoxUtils experimental

block

Beta

边界框工具类,提供许多用于创建和使用 BlockBoundingBox 对象的有用函数。

Bounding Box Utils is a utility class that provides a number of useful functions for the creation and utility of BlockBoundingBox objects

Methods

createValid()

static createValid(min, max): BlockBoundingBox

World Mutation Beta

Parameters

min

Vector3

一个角点的世界坐标位置。

A corner world location

max

Vector3

对角线相对的另一个角点的世界坐标位置。

A corner world location diametrically opposite

Returns

BlockBoundingBox

Remarks

创建一个经过验证的 BlockBoundingBox 实例,其中 min 和 max 分量保证满足 (min <= max)。

Create a validated instance of a BlockBoundingBox where the min and max components are guaranteed to be (min <= max)


dilate()

static dilate(box, size): BlockBoundingBox

World Mutation Beta

Parameters

box

BlockBoundingBox

size

Vector3

Returns

BlockBoundingBox

返回一个新的 BlockBoundingBox 对象,表示更改后的结果。

Return a new BlockBoundingBox object representing the changes

Remarks

沿各轴按给定大小扩展一个 BlockBoundingBox。 大小可以为负数以实现收缩。 注意:如果收缩大小大于跨度,角点可能被反转,但 min/max 关系将保持正确。

Expand a BlockBoundingBox by a given amount along each axis. Sizes can be negative to perform contraction. Note: corners can be inverted if the contraction size is greater than the span, but the min/max relationship will remain correct


equals()

static equals(box, other): boolean

World Mutation Beta

Parameters

box

BlockBoundingBox

other

BlockBoundingBox

Returns

boolean

Remarks

检查两个 BlockBoundingBox 对象是否完全相同。

Check if two BlockBoundingBox objects are identical


expand()

static expand(box, other): BlockBoundingBox

World Mutation Beta

Parameters

box

BlockBoundingBox

other

BlockBoundingBox

Returns

BlockBoundingBox

一个新的 BlockBoundingBox 实例,表示能够同时包含两者的最小可能边界框。

A new BlockBoundingBox instance representing the smallest possible bounding box which can encompass both

Remarks

扩展初始 box 对象的边界以包含第二个 box 参数。 生成的 BlockBoundingBox 对象将是一个恰好包含这两个盒子的 BlockBoundingBox

Expand the initial box object bounds to include the 2nd box argument. The resultant BlockBoundingBox object will be a BlockBoundingBox which exactly encompasses the two boxes.


getCenter()

static getCenter(box): Vector3

World Mutation Beta

Parameters

box

BlockBoundingBox

Returns

Vector3

注意 BlockBoundingBox 对象表示完整的方块,因此具有奇数边界的盒子的中心在数学上并不居中。 例如,BlockBoundingBox(0,0,0 -> 3,3,3) 的中心为 (1,1,1)(而不是预期的 (1.5,1.5,1.5))。

Note that BlockBoundingBox objects represent whole blocks, so the center of boxes which have odd numbered bounds are not mathematically centered... i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)

Remarks

计算给定 BlockBoundingBox 对象的中心方块。

Calculate the center block of a given BlockBoundingBox object.


getIntersection()

static getIntersection(box, other): BlockBoundingBox | undefined

World Mutation Beta

Parameters

box

BlockBoundingBox

other

BlockBoundingBox

Returns

BlockBoundingBox | undefined

Remarks

计算表示两个相交 BlockBoundingBox 的并集区域的 BlockBoundingBox

Calculate the BlockBoundingBox which represents the union area of two intersecting BlockBoundingBoxes


getSpan()

static getSpan(box): Vector3

World Mutation Beta

Parameters

box

BlockBoundingBox

Returns

Vector3

Remarks

获取 BlockBoundingBox 各轴分量的跨度。

Get the Span of each of the BlockBoundingBox Axis components


intersects()

static intersects(box, other): boolean

World Mutation Beta

Parameters

box

BlockBoundingBox

other

BlockBoundingBox

Returns

boolean

Remarks

检查两个 BlockBoundingBox 对象是否相交。

Check to see if two BlockBoundingBox objects intersect


isInside()

static isInside(box, pos): boolean

World Mutation Beta

Parameters

box

BlockBoundingBox

pos

Vector3

Returns

boolean

Remarks

检查给定的坐标是否在 BlockBoundingBox 内部。

Check to see if a given coordinate is inside a BlockBoundingBox


isValid()

static isValid(box): boolean

World Mutation Beta

Parameters

box

BlockBoundingBox

Returns

boolean

Remarks

检查 BlockBoundingBox 是否有效(即 min <= max)。

Check to see if a BlockBoundingBox is valid (i.e. (min <= max))


translate()

static translate(box, delta): BlockBoundingBox

World Mutation Beta

Parameters

box

BlockBoundingBox

delta

Vector3

Returns

BlockBoundingBox

返回一个新的 BlockBoundingBox 对象,表示移动后的结果。

Return a new BlockBoundingBox object which represents the change

Remarks

按给定量移动 BlockBoundingBox

Move a BlockBoundingBox by a given amount

同领域相关