Table of Contents

Struct FixedBoundVolume

Namespace
SwiftCollections.Query
Assembly
SwiftCollections.FixedMathSharp.dll

Represents an axis-aligned bounding box (AABB) in 3D space using fixed-point math.

public struct FixedBoundVolume : IBoundVolume<FixedBoundVolume>, IEquatable<FixedBoundVolume>
Implements
Inherited Members

Remarks

Construction normalizes swapped endpoints. Derived center and size semantics are inherited from FixedMathSharp.Geometry.FixedBoundBox.

Constructors

FixedBoundVolume(Vector3d, Vector3d)

Initializes a new instance of the FixedBoundVolume struct.

public FixedBoundVolume(Vector3d min, Vector3d max)

Parameters

min Vector3d

One endpoint of the volume.

max Vector3d

The opposite endpoint of the volume.

Properties

Center

Gets the nearest-even Q32.32 center point of the bounding volume.

public Vector3d Center { get; }

Property Value

Vector3d

Max

Gets the maximum point of the bounding volume.

public Vector3d Max { get; }

Property Value

Vector3d

Min

Gets the minimum point of the bounding volume.

public Vector3d Min { get; }

Property Value

Vector3d

Size

Gets the exact axis-aligned size of the bounding volume.

public Vector3d Size { get; }

Property Value

Vector3d

Exceptions

OverflowException

A positive component span is outside the representable scalar domain.

Volume

Gets the volume of the bounding box.

public Fixed64 Volume { get; }

Property Value

Fixed64

Exceptions

OverflowException

A positive component span is outside the representable scalar domain.

Methods

BoundsEquals(FixedBoundVolume)

Determines whether the bounds of this volume are equal to those of the specified volume.

public bool BoundsEquals(FixedBoundVolume other)

Parameters

other FixedBoundVolume

A FixedBoundVolume to compare with the current volume.

Returns

bool

true if both the minimum and maximum bounds of the volumes are equal; otherwise, false.

Equals(FixedBoundVolume)

public bool Equals(FixedBoundVolume other)

Parameters

other FixedBoundVolume

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetCost(FixedBoundVolume)

Calculates the additional volume required to expand the current volume to fully contain the specified volume.

public long GetCost(FixedBoundVolume other)

Parameters

other FixedBoundVolume

The volume to be encompassed by the current volume.

Returns

long

The floored additional volume needed to contain the specified volume, clamped to MaxValue. Returns 0 when the current volume already contains the specified volume.

GetHashCode()

public override int GetHashCode()

Returns

int

Intersects(FixedBoundVolume)

Determines whether this volume intersects with the specified volume.

public bool Intersects(FixedBoundVolume other)

Parameters

other FixedBoundVolume

The volume to test for intersection with this volume.

Returns

bool

true if the volumes intersect; otherwise, false.

ToString()

Returns a string that represents the current object, including the minimum and maximum values.

public override string ToString()

Returns

string

A string in the format "Min: {Min}, Max: {Max}" that displays the minimum and maximum values of the object.

Union(FixedBoundVolume)

Creates a new volume that represents the union of this volume and the specified volume.

public FixedBoundVolume Union(FixedBoundVolume other)

Parameters

other FixedBoundVolume

The volume to combine with this volume. The resulting volume will encompass both this volume and the specified volume.

Returns

FixedBoundVolume

A new FixedBoundVolume that contains both this volume and the specified volume.

Remarks

The resulting volume is the smallest axis-aligned bounding box that fully contains both input volumes.

Operators

operator ==(FixedBoundVolume, FixedBoundVolume)

Determines whether two BoundVolume instances are equal.

public static bool operator ==(FixedBoundVolume left, FixedBoundVolume right)

Parameters

left FixedBoundVolume
right FixedBoundVolume

Returns

bool

operator !=(FixedBoundVolume, FixedBoundVolume)

Determines whether two BoundVolume instances are not equal.

public static bool operator !=(FixedBoundVolume left, FixedBoundVolume right)

Parameters

left FixedBoundVolume
right FixedBoundVolume

Returns

bool