Description
The Maxs
field represents the maximum corner extents of the Axis-Aligned Bounding Box (AABB). It is a Vector3
that defines the farthest point on each axis of the bounding box. The values of Maxs
should be mathematically larger than the corresponding values of the Mins
field, which represents the minimum corner extents of the AABB. This ensures that the bounding box is correctly defined in 3D space.
Usage
Use the Maxs
field to determine the upper bounds of the AABB in 3D space. It is important to ensure that the values in Maxs
are greater than those in Mins
to maintain a valid bounding box. This field is typically used in conjunction with Mins
to perform operations such as collision detection, spatial queries, and rendering calculations.
Example
// Example of using BBox and its Maxs field
BBox boundingBox = new BBox();
boundingBox.Mins = new Vector3(0, 0, 0);
boundingBox.Maxs = new Vector3(10, 10, 10);
// Check if a point is within the bounding box
Vector3 point = new Vector3(5, 5, 5);
bool isInside = boundingBox.Contains(point); // Returns true
// Calculate the size of the bounding box
Vector3 size = boundingBox.Size; // Returns Vector3(10, 10, 10)