Struct AxisAlignedBox
- Namespace
- MathAssertions.Geometry3D
- Assembly
- MathAssertions.dll
Axis-aligned bounding box (AABB) defined by minimum and maximum corners. The box is
well-formed when Min <= Max component-wise; the computed properties remain
well-defined for inverted boxes (Size components turn negative, Volume
becomes signed) but containment and intersection methods on inverted boxes return
undefined results. Callers are responsible for constructing valid boxes.
public readonly record struct AxisAlignedBox : IEquatable<AxisAlignedBox>
- Implements
- Inherited Members
- Extension Methods
Constructors
AxisAlignedBox(Vector3, Vector3)
Axis-aligned bounding box (AABB) defined by minimum and maximum corners. The box is
well-formed when Min <= Max component-wise; the computed properties remain
well-defined for inverted boxes (Size components turn negative, Volume
becomes signed) but containment and intersection methods on inverted boxes return
undefined results. Callers are responsible for constructing valid boxes.
public AxisAlignedBox(Vector3 Min, Vector3 Max)
Parameters
Properties
Center
Geometric center of the box: (Min + Max) / 2.
public Vector3 Center { get; }
Property Value
HalfExtents
Component-wise half-extents: Size / 2.
public Vector3 HalfExtents { get; }
Property Value
Max
Maximum corner.
public Vector3 Max { get; init; }
Property Value
Min
Minimum corner.
public Vector3 Min { get; init; }
Property Value
Size
Component-wise size: Max - Min.
public Vector3 Size { get; }
Property Value
Volume
Volume of the box: Size.X * Size.Y * Size.Z. Signed for inverted boxes.
public float Volume { get; }