@minecraft
    正在准备搜索索引...

    类 AABBUtils

    Utilities operating on AABB objects. All methods are static and do not modify the input objects.

    索引

    属性

    EPSILON: number

    EPSILON

    The internal epsilon value that determines validity and used for block volume tolerance.

    方法

    • equals

      Compares the equality of two AABBs.

      参数

      • aabb: AABB

        The first AABB in the comparison.

      • other: AABB

        The second AABB in the comparison.

      返回 boolean

      • True if the center and extent of both AABBs are equal.

      AABBInvalidExtentError This exception is thrown if either of the input AABBs are invalid.

    • getIntersection

      Creates an AABB of the intersecting area of two source AABBs.

      参数

      • aabb: AABB

        The first source AABB.

      • other: AABB

        The second source AABB.

      返回 AABB

      • The resulting intersecting AABB if they intersect, otherwise returns undefined.

      AABBInvalidExtentError This exception is thrown if either of the input AABBs are invalid.

    • intersects

      Calculates if two AABBs are intersecting.

      参数

      • aabb: AABB

        The first AABB.

      • other: AABB

        The second AABB.

      返回 boolean

      • True if the AABBs are intersecting, otherwise false.

      AABBInvalidExtentError This exception is thrown if either of the input AABBs are invalid.

    • isInside

      Calculates if a position is inside of an AABB.

      参数

      • aabb: AABB

        The AABB to test against.

      • pos: Vector3

        The position to test.

      返回 boolean

      True if the position is inside of the AABB, otherwise returns false.

      AABBInvalidExtentError This exception is thrown if the input AABB is invalid.

    • isValid

      Determines if the AABB has non-zero extent on all axes.

      参数

      • aabb: AABB

        The AABB to test for validity.

      返回 boolean

      • True if all extent axes are non-zero, otherwise false.
    • throwErrorIfInvalid

      Throws an error if the AABB is invalid.

      参数

      • aabb: AABB

        The AABB to test for validity.

      返回 void

      AABBInvalidExtentError This exception is thrown if the input AABB is invalid.

    • translate

      Creates a translated AABB given a source AABB and translation vector.

      参数

      • aabb: AABB

        The source AABB.

      • delta: Vector3

        The translation vector to add to the AABBs center.

      返回 AABB

      • The resulting translated AABB.

      AABBInvalidExtentError This exception is thrown if the input AABB is invalid.