Method VoxelIndexToWorldMinCorner
| Edit this page View SourceVoxelIndexToWorldMinCorner(int, int, int, Vector3)
Converts voxel grid index to world position of its minimum corner.
Declaration
public static Vector3 VoxelIndexToWorldMinCorner(int x, int y, int z, Vector3 voxelSize)
Parameters
| Type | Name | Description |
|---|---|---|
| int | x | The X grid index |
| int | y | The Y grid index |
| int | z | The Z grid index |
| Vector3 | voxelSize | The size of each voxel in world units |
Returns
| Type | Description |
|---|---|
| Vector3 | The world position of the voxel's minimum corner |
VoxelIndexToWorldMinCorner(int, int, int, Vector3, Vector3)
Converts voxel grid index to world position of its minimum corner with custom grid origin.
Declaration
public static Vector3 VoxelIndexToWorldMinCorner(int x, int y, int z, Vector3 voxelSize, Vector3 gridOrigin)
Parameters
| Type | Name | Description |
|---|---|---|
| int | x | The X grid index |
| int | y | The Y grid index |
| int | z | The Z grid index |
| Vector3 | voxelSize | The size of each voxel in world units |
| Vector3 | gridOrigin | The world position of the grid's origin (minimum corner of voxel (0,0,0)) |
Returns
| Type | Description |
|---|---|
| Vector3 | The world position of the voxel's minimum corner |