starry-math
    Preparing search index...

    Class Box3

    Represents an axis-aligned bounding box (AABB) in 3D space. The box is defined by its minimum and maximum corner points.

    Index

    Constructors

    • Creates a new Box3 bounding box

      Parameters

      • min: Vector3 = ...

        Minimum point defining the bounding box. Defaults to a new Vector3() (0, 0, 0)

      • max: Vector3 = ...

        Maximum point defining the bounding box. Defaults to a new Vector3() (0, 0, 0)

      Returns Box3

    Properties

    max: Vector3

    The maximum point of the box, representing the corner with largest coordinates.

    min: Vector3

    The minimum point of the box, representing the corner with smallest coordinates.

    Methods

    • Creates a new Box3 with the same boundaries as this box.

      Returns Box3

      A new Box3 instance with copied boundaries

    • Copies the boundaries of another box into this box.

      Parameters

      • box: Box3

        The box to copy from

      Returns this

      Returns the current Box3 instance for method chaining

    • Determines if this box is equal to another box by comparing their min and max points.

      Parameters

      • box: Box3

        The box to compare with

      Returns boolean

      True if the boxes are equal, false otherwise

    • Expands the box by the given number in all directions.

      Parameters

      • num: number

        The amount to expand the box by

      Returns this

      Returns the current Box3 instance for method chaining

    • Expands the box by the given vector in all directions.

      Parameters

      • vector: Vector3

        The vector defining the expansion amounts along each axis

      Returns this

      Returns the current Box3 instance for method chaining

    • Sets the boundaries of this box using the provided min and max points.

      Parameters

      • min: Vector3

        The new minimum point for the box

      • max: Vector3

        The new maximum point for the box

      Returns this

      Returns the current Box3 instance for method chaining