Table of Contents

Struct ClusterWorldAabb

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

A cluster's tight bounds in world coordinates, f64 — what SpatialBounds hands back (#914).

public readonly struct ClusterWorldAabb
Inherited Members

Remarks

Why this is not a ClusterSpatialAabb. That type is the STORED form, and its own documentation is emphatic about what that means: six f32 components measured from the cell's origin, per C15. Returning world coordinates in it worked by writing world values into cell-relative fields — the same struct meaning two different things depending on which side of a property you were on, with nothing in the type to say which you were holding. A caller that passed the result back into anything expecting stored bounds would have been wrong by the whole distance to the cell origin, silently.

Why f64. The world frame is f64 since #914 and this is a world coordinate. At 10⁹ an f32 resolves to ~64-unit steps — coarser than most clusters are wide — so an f32 world box would have reported every cluster in a distant region as the same box. The stored bounds stay f32 and stay cell-relative; that is the floating-origin bargain, and this type is where the two frames meet.

For a 2D archetype MinZ/MaxZ carry the ±∞ empty sentinel through unchanged (∞ + a finite origin is ∞), exactly as the stored form leaves them — read X and Y only.

Constructors

ClusterWorldAabb(double, double, double, double, double, double, uint)

Construct from six world-space bounds and a category mask.

public ClusterWorldAabb(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, uint categoryMask)

Parameters

minX double
minY double
minZ double
maxX double
maxY double
maxZ double
categoryMask uint

Fields

CategoryMask

OR of every entity category mask in the cluster, carried through from the stored bounds.

public readonly uint CategoryMask

Field Value

uint

MaxX

Maximum X, in world units.

public readonly double MaxX

Field Value

double

MaxY

Maximum Y, in world units.

public readonly double MaxY

Field Value

double

MaxZ

Maximum Z, in world units. The -∞ empty sentinel for a 2D archetype.

public readonly double MaxZ

Field Value

double

MinX

Minimum X, in world units.

public readonly double MinX

Field Value

double

MinY

Minimum Y, in world units.

public readonly double MinY

Field Value

double

MinZ

Minimum Z, in world units. The +∞ empty sentinel for a 2D archetype.

public readonly double MinZ

Field Value

double

Properties

Empty

The empty sentinel — min at +∞, max at -∞ on every axis, the seed a union starts from.

public static ClusterWorldAabb Empty { get; }

Property Value

ClusterWorldAabb

IsEmpty

True when no entity has been unioned in — MinX is still the +∞ seed.

public bool IsEmpty { get; }

Property Value

bool

Methods

FromCellRelative(in ClusterSpatialAabb, double, double, double)

Convert a stored C15 cell-relative box to world space, given its cell's origin.

public static ClusterWorldAabb FromCellRelative(in ClusterSpatialAabb box, double originX, double originY, double originZ)

Parameters

box ClusterSpatialAabb
originX double
originY double
originZ double

Returns

ClusterWorldAabb