BoundsBox
Represents an axis-aligned bounding box (AABB) in 3D space.
Fields
Functions
Creates a bounding box centered at the specified position with the given size.
- origin
- The origin point for the position, where 0 is relative to start, 0.5 is center, and 1 is end.
- position
- The position of the bounding box at the specified origin.
- size
- The size of the bounding box.
Returns: A new bounding box of the requested size positioned at using as the anchor.
Transforms the bounding box's eight corners by and returns the axis-aligned box that contains all of them.
- cMatrix
- The transform to apply to each corner.
Returns: A new axis-aligned bounding box that encloses the transformed corners.
Gets the size of the bounding box (dimensions along each axis).
Returns: A vector representing the size of the bounding box.
Gets the center point of the bounding box.
Returns: A vector representing the center of the bounding box.
Sets the center point of the bounding box, keeping its size unchanged.
- center
- The new center point for the bounding box.
Determines whether this bounding box contains the specified point.
- point
- The point to test.
Returns: True if the point is inside or on the boundary of the bounding box; otherwise, false.
Determines whether this bounding box contains another bounding box entirely.
- other
- The other bounding box to test.
Returns: True if the other bounding box is completely inside this one; otherwise, false.
Determines whether this bounding box intersects with another bounding box.
- other
- The other bounding box to test.
Returns: True if the bounding boxes overlap; otherwise, false.
Expands this bounding box to contain another bounding box.
- other
- The bounding box to include.
Returns: This bounding box, expanded to contain the other bounding box.
Expands this bounding box to contain a point.
- point
- The point to include.
Returns: This bounding box, expanded to contain the point.
Grows the bounding box by the specified margin on all sides.
- margin
- The amount to grow each side by.
Returns: This bounding box, grown by the specified margin.
Grows the bounding box by the specified margins on each axis.
- margins
- The amount to grow each side by for each axis.
Returns: This bounding box, grown by the specified margins.
Returns a copy of this bounding box that has been grown by the specified margin.
- margin
- The amount to grow each side by.
Returns: A new bounding box grown by the specified margin.
Returns a copy of this bounding box that has been grown by the specified margins.
- margins
- The amount to grow each side by for each axis.
Returns: A new bounding box grown by the specified margins.
Computes the intersection of this bounding box with another bounding box.
- other
- The other bounding box to intersect with.
Returns: A new bounding box representing the intersection, or null if they don't intersect.