public byte GetVoxelContent(ref Vector3I voxelCoordInCell)
{
if (this.CellType == MyVoxelCellType.EMPTY)
{
// Cell is empty, therefore voxel must be empty too.
return MyVoxelConstants.VOXEL_CONTENT_EMPTY;
}
else if (this.CellType == MyVoxelCellType.FULL)
{
// Cell is full, therefore voxel must be full too.
return MyVoxelConstants.VOXEL_CONTENT_FULL;
}
else
{
// If cell is mixed, get voxel's content from the cell's content.
// Content was allocated before, we don't need to do it now (or even check it).
if (this._cellContent != null)
{
return this._cellContent.GetVoxelContent(ref voxelCoordInCell);
}
return 0;
}
}