Method ForEachVoxel
| Edit this page View SourceForEachVoxel<T>(IGrid<T>, Action<Vector3, T>)
Enumerate all voxels in the grid, invoking the given action for each voxel.
Declaration
public static void ForEachVoxel<T>(this IGrid<T> g, Action<Vector3, T> action)
Parameters
| Type | Name | Description |
|---|---|---|
| IGrid<T> | g | The grid to enumerate. |
| Action<Vector3, T> | action | Action to invoke for each voxel, with parameters (position, value) |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
x-fastest iteration order.
grid.ForEachVoxel((pos, val) => {/* ... */});