magic-pixels
    Preparing search index...

    Class Box3

    An axis-aligned bounding box: the smallest box with sides parallel to the coordinate axes that contains a set of points. It is stored as its min and max corners. A box with min > max is empty, contains nothing and is what a new box starts as, so points can be added with expandByPoint() without a special first step.

    Operations work in place and return this.

    Index
    max: Vector = ...
    min: Vector = ...
    • get isEmpty(): boolean

      true if the box contains no points at all

      Returns boolean

    • Transform the box by a matrix. A rotated box is no longer axis-aligned, so the result is the axis-aligned box around the eight transformed corners: never smaller than the true extent, but larger after a rotation.

      Parameters

      Returns this

    • Grow the box so that it contains the point (x, y, z)

      Parameters

      • x: number
      • y: number
      • z: number

      Returns this

    • Grow the box so that it contains point

      Parameters

      Returns this

    • Replace the box by the smallest one containing all points

      Parameters

      Returns this

    • Grow the box so that it contains other as well

      Parameters

      Returns this