Constructor DataGrid
| Edit this page View SourceDataGrid(GridMeta)
Initialize an empty DataGrid with the existing metadata.
Declaration
public DataGrid(GridMeta meta)
Parameters
| Type | Name | Description |
|---|---|---|
| GridMeta | meta | The metadata that defines the dimensions, voxel size, and origin of the grid. The grid will be initialized based on this metadata. |
DataGrid(Vector3, BBox, int)
Constructs a DataGrid with the specified voxel size and bounds.
Declaration
public DataGrid(Vector3 voxelSize, BBox bounds, int paddingVoxels = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | voxelSize | Size of each voxel in world units, typically representing the resolution of the grid. |
| BBox | bounds | World-space axis-aligned bounding box that the grid should cover. The grid will be initialized to encompass this area. |
| int | paddingVoxels | Number of voxels to pad around the bounds in each dimension. |
DataGrid(GridMeta, ReadOnlySpan<T>)
Constructs a DataGrid wrapping an existing data buffer.
Declaration
public DataGrid(GridMeta meta, ReadOnlySpan<T> data)
Parameters
| Type | Name | Description |
|---|---|---|
| GridMeta | meta | Metadata describing the grid dimensions and voxel size. |
| ReadOnlySpan<T> | data | Actual data buffer to wrap. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If the length of the provided data does not match the expected size based on the grid metadata. |