Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Vector/llms.txt
Use this file to discover all available pages before exploring further.
AABB (Axis-Aligned Bounding Box) represents a rectangular volume in 3D space whose edges are always parallel to the world axes. It is defined by its minimum and maximum corner points (Float3 Min and Float3 Max) and implements IBoundingShape for GJK-based collision detection. The struct lives in the Prowl.Vector namespace.
Declaration
Fields
| Field | Type | Description |
|---|---|---|
Min | Float3 | The minimum corner of the box (smallest X, Y, Z). |
Max | Float3 | The maximum corner of the box (largest X, Y, Z). |
The constructors automatically sort Min and Max — you can pass corners in any order and the AABB will always be valid.
Constructors
From two Float3 corners
From six individual components
Float3 constructor.
Static Factory Methods
FromCenterAndSize
center with the given size (width, height, depth). Internally computes Min = center - size / 2 and Max = center + size / 2.
FromPoints
points. Returns a zero-size AABB at the origin if points is null or empty.
FromAABBs
FromSphere
sphere.
Properties
| Property | Type | Description |
|---|---|---|
Center | Float3 | (Min + Max) / 2 — the geometric center. |
Size | Float3 | Max - Min — the full width, height, and depth. |
Extents | Float3 | Size / 2 — the half-extents from the center. |
Volume | float | Size.X * Size.Y * Size.Z. |
SurfaceArea | float | 2 * (X*Y + Y*Z + Z*X). |
Methods
Contains
Contains(Float3)— returnstrueif the point lies inside or on the boundary (uses a small epsilon tolerance).Contains(AABB)— returnstrueifotheris completely inside this AABB (all eight corners).
Intersects
true when the two shapes overlap or touch. Internally delegates to Intersection.AABBAABBOverlap and Intersection.SphereAABBOverlap.
ClosestPointTo
point. If the point is inside the box, it returns point itself.
GetDistanceToPoint / GetSqrDistanceToPoint
point to the surface of the AABB. Returns 0 when the point is inside.
Expand / Expanded
Expand— mutates the AABB, movingMinoutward byamountandMaxinward byamountin each axis.Expanded— returns a new AABB without mutating the original.- Per-axis overloads let you expand different amounts on each axis.
Encapsulate / Encapsulating
Encapsulate) modify in place; Encapsulating returns a new copy.
GetCorner / GetCorners
GetFaceNormal / GetFaceCenter
0 = −X, 1 = +X, 2 = −Y, 3 = +Y, 4 = −Z, 5 = +Z.
TransformBy
matrix and returns the tightest AABB that contains all transformed corners. Handles non-uniform scale and rotation (result is always axis-aligned).
ClippedBy
IsValid / IsEmpty
IsValid— returnstruewhenMin ≤ Maxin all axes.IsEmpty— returnstruewhen the volume is effectively zero.
SampleVolume
RNG.Shared.
SupportMap (IBoundingShape)
direction. Used by GJK/EPA collision algorithms. Implementation: picks Max.X or Min.X based on direction.X ≥ 0, and similarly for Y and Z.
Operators
| Operator | Description |
|---|---|
== | True when Min and Max are equal. |
!= | Inverse of ==. |
Code Example
Notes
AABBis a struct — mutations likeEncapsulateandExpandmodify the value directly; pass by reference if you need to mutate a field on a class.ContainsandIntersectsuse a smallfloat.Epsilontolerance on the boundary, so points exactly on the face returntrue.- For concave or rotated shapes consider computing an AABB as a loose bounding volume first, then refining with a narrower test.