Method GetVoxelBounds
| Edit this page View SourceGetVoxelBounds(ReadOnlySpan<Vector3>, ReadOnlySpan<Vector3>, Span<BBox>)
Gets axis-aligned bounding boxes for a set of voxels.
Declaration
public static void GetVoxelBounds(ReadOnlySpan<Vector3> origins, ReadOnlySpan<Vector3> voxelSizes, Span<BBox> outBoxes)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<Vector3> | origins | Voxel origins |
| ReadOnlySpan<Vector3> | voxelSizes | Per-voxel sizes; must match |
| Span<BBox> | outBoxes | Pre-allocated output span to write bounding boxes into; must match |
Remarks
This variant avoids allocations by writing into a pre-allocated output Span<T>.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | voxelSizes length must match voxels length. |
GetVoxelBounds(ReadOnlySpan<Vector3>, ReadOnlySpan<Vector3>)
Gets axis-aligned bounding boxes for a set of voxels.
Declaration
public static BBox[] GetVoxelBounds(ReadOnlySpan<Vector3> origins, ReadOnlySpan<Vector3> voxelSizes)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<Vector3> | origins | Voxel origins |
| ReadOnlySpan<Vector3> | voxelSizes | Per-voxel sizes; must match |
Returns
| Type | Description |
|---|---|
| BBox[] | Array of bounding boxes, one per input voxel. |
Remarks
This variant allocates a new array for the output bounding boxes.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | voxelSizes length must match voxels length. |
GetVoxelBounds(ReadOnlySpan<Vector3>, Vector3, Span<BBox>)
Gets axis-aligned bounding boxes for a set of voxels (all voxels share the same voxelSize).
Declaration
public static void GetVoxelBounds(ReadOnlySpan<Vector3> origins, Vector3 voxelSize, Span<BBox> outBoxes)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<Vector3> | origins | Voxel origins |
| Vector3 | voxelSize | Per-voxel sizes |
| Span<BBox> | outBoxes | Pre-allocated output span to write bounding boxes into; must match |
Remarks
This variant avoids allocations by writing into a pre-allocated output Span<T>.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Output span is too small to hold all bounding boxes. |
GetVoxelBounds(ReadOnlySpan<Vector3>, Vector3)
Gets axis-aligned bounding boxes for a set of voxels (all voxels share the same voxelSize).
Declaration
public static BBox[] GetVoxelBounds(ReadOnlySpan<Vector3> origins, Vector3 voxelSize)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<Vector3> | origins | Voxel origins |
| Vector3 | voxelSize | Per-voxel sizes |
Returns
| Type | Description |
|---|---|
| BBox[] | Array of bounding boxes, one per input voxel. |
Remarks
This variant allocates a new array for the output bounding boxes.