Interface IBoundVolume<TVolume>
- Namespace
- SwiftCollections.Query
- Assembly
- SwiftCollections.dll
Represents a strongly-typed bounding volume contract for spatial operations.
public interface IBoundVolume<TVolume> where TVolume : struct, IBoundVolume<TVolume>
Type Parameters
TVolumeThe concrete bounding volume type.
Methods
BoundsEquals(TVolume)
Determines whether the bounds represent the same spatial region.
bool BoundsEquals(TVolume other)
Parameters
otherTVolumeThe other bounding volume to compare against.
Returns
- bool
True when both bounds share the same minimum and maximum extents; otherwise, false.
GetCost(TVolume)
Calculates the cost of combining the current bounding volume with another. Used as the SAH insertion metric; returned as long to avoid overflow in worlds with large coordinate ranges.
long GetCost(TVolume other)
Parameters
otherTVolumeThe other bounding volume to consider.
Returns
- long
The cost metric of the union operation.
Intersects(TVolume)
Determines whether the current bounding volume intersects with another.
bool Intersects(TVolume other)
Parameters
otherTVolumeThe other bounding volume to test for intersection.
Returns
- bool
True if the volumes intersect; otherwise, false.
Union(TVolume)
Combines the current bounding volume with another, creating a new volume that encloses both.
TVolume Union(TVolume other)
Parameters
otherTVolumeThe other bounding volume to combine with.
Returns
- TVolume
A new bounding volume that contains both the current and other volumes.