AxisAlignedBox

Summary

Represents an axis-aligned bounding box (AABB) 3D space defined by minimum and maximum extents.

Definition

Namespace: SDT4.Managed.Core.Math
Assembly: SDT4.Managed.Core.dll

struct AxisAlignedBox
Implements:

IEquatable<AxisAlignedBox>

Fields

Name Type Description
public Min Vector3f The minimum corner point of the bounding box.
public Max Vector3f The maximum corner point of the bounding box.

Properties

Name Type Description
public static get; Infinite AxisAlignedBox Gets an infinite bounding box where minimum bounds exceed maximum bounds.
public get; set; Extent Vector3f Gets or sets the total size across all dimensions (Max - Min).
public get; set; Position Vector3f Gets or sets the centre position of the bounding box.
public get; HalfExtent Vector3f Gets the half-extents of the bounding box (Extent * 0.5f).
public get; IsValid Boolean Gets a value indicating whether the bounding box is valid, meaning all components of AxisAlignedBox.Min are less than or equal to AxisAlignedBox.Max.
Extent Remarks

Modifying the extent scales the box symmetrically around its current centre position.

Position Remarks

Modifying the position translates the box while preserving its current dimensions.


Methods

public Boolean Intersects(AxisAlignedBox other)

Summary: Determines whether this bounding box intersects another bounding box.

Parameters:

Returns:


public Boolean Intersect(AxisAlignedBox other, out AxisAlignedBox result)

Summary: Computes the intersection of this bounding box with another.

Parameters:

Returns:


public Boolean Contains(Vector3f point)

Summary: Determines whether a point lies within or on the boundaries of this bounding box.

Parameters:

Returns:


public Boolean Contains(AxisAlignedBox other)

Summary: Determines whether another bounding box is completely enclosed within this bounding box.

Parameters:

Returns:


public Void Grow(Vector3f point)

Summary: Expands the bounding box to encapsulate the specified point.

Parameters:


public Void Grow(AxisAlignedBox other)

Summary: Expands the bounding box to encapsulate another bounding box.

Parameters:


public static AxisAlignedBox Union(AxisAlignedBox a, AxisAlignedBox b)

Summary: Computes the union of two bounding boxes.

Parameters:

Returns:


public Vector3f ClosestPoint(Vector3f point)

Summary: Clamps a point to the boundaries of the bounding box.

Parameters:

Returns:


public Single DistanceSquared(Vector3f point)

Summary: Returns the squared distance from a point to the nearest point on the bounding box.

Parameters:

Returns:


public Void GetCorners(Span<Vector3f> corners)

Summary: Populates an array of 8 vertices representing the corners of the box.

Parameters:


public Boolean Equals(AxisAlignedBox other)

Summary: Determines whether the specified AxisAlignedBox is equal to the current instance.

Parameters:

Returns:


public virtual Boolean Equals(Object? obj)

Summary: Determines whether the specified object is equal to the current instance.

Parameters:

Returns:


public virtual Int32 GetHashCode()

Summary: Returns the hash code for this bounding box.

Returns:


public virtual String ToString()

Summary: Formats the bounding box as a readable string displaying minimum and maximum bounds.

Returns: