类 BoundingBoxUtils实验性

Bounding Box Utils 是一个实用工具类,提供了许多用于创建和操作 BoundingBox 对象的实用功能。

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

方法

  • 实验性

    参数

    • min: Vector3

      一个角落的世界坐标位置

      A corner world location

    • max: Vector3

      与之对角相对的世界坐标位置

      A corner world location diametrically opposite

    返回 BoundingBox

    创建一个已验证的 BoundingBox 实例,其中最小值和最大值的组件保证满足 (min <= max)。

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

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 BoundingBox

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

    Return a new BoundingBox object representing the changes

    按每个轴上的给定量扩展一个 BoundingBox。 大小可以为负数以执行收缩。 注意:若收缩大小大于跨度,则角点可能会被反转,但最小值/最大值的关系将保持正确。

    Expand a BoundingBox 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

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 BoundingBox

    一个新的 BoundingBox 实例,表示可以包围两者的最小可能边界框。

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

    扩展初始边界框对象的范围以包含第二个边界框参数。 结果是一个 BoundingBox 对象,该对象完全包围两个边界框。

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

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 Vector3

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

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

    计算给定 BoundingBox 对象的中心块。

    Calculate the center block of a given BoundingBox object.

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 Vector3

    获取边界框每个轴分量的跨度。

    Get the Span of each of the BoundingBox Axis components

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 boolean

    检查两个边界框对象是否相交。

    Check to see if two BoundingBox objects intersect

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 boolean

    检查给定坐标是否在边界框内。

    Check to see if a given coordinate is inside a BoundingBox

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 boolean

    检查边界框是否有效(即 min <= max)。

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

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

  • 实验性

    参数

    返回 BoundingBox

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

    Return a new BoundingBox object which represents the change

    按给定的增量移动一个边界框。

    Move a BoundingBox by a given amount

    无法在只读模式下调用此函数,详见 WorldBeforeEvents