SEToolbox.Interop.Asteroids.MyVoxelMap.RemoveContent C# (CSharp) Method

RemoveContent() public method

public RemoveContent ( ) : void
return void
        public void RemoveContent()
        {
            Vector3I cellCoord;

            for (cellCoord.X = 0; cellCoord.X < _dataCellsCount.X; cellCoord.X++)
            {
                for (cellCoord.Y = 0; cellCoord.Y < _dataCellsCount.Y; cellCoord.Y++)
                {
                    for (cellCoord.Z = 0; cellCoord.Z < _dataCellsCount.Z; cellCoord.Z++)
                    {
                        var voxelCell = _voxelContentCells[cellCoord.X][cellCoord.Y][cellCoord.Z];

                        if (voxelCell == null)
                        {
                            var newCell = new MyVoxelContentCell();
                            _voxelContentCells[cellCoord.X][cellCoord.Y][cellCoord.Z] = newCell;
                            newCell.SetToEmpty();
                        }
                        else if (voxelCell.CellType == MyVoxelCellType.MIXED)
                        {
                            // A mixed cell.
                            Vector3I voxelCoordInCell;
                            for (voxelCoordInCell.X = 0; voxelCoordInCell.X < MyVoxelConstants.VOXEL_DATA_CELL_SIZE_IN_VOXELS; voxelCoordInCell.X++)
                            {
                                for (voxelCoordInCell.Y = 0; voxelCoordInCell.Y < MyVoxelConstants.VOXEL_DATA_CELL_SIZE_IN_VOXELS; voxelCoordInCell.Y++)
                                {
                                    for (voxelCoordInCell.Z = 0; voxelCoordInCell.Z < MyVoxelConstants.VOXEL_DATA_CELL_SIZE_IN_VOXELS; voxelCoordInCell.Z++)
                                    {
                                        voxelCell.SetVoxelContent(0x00, ref voxelCoordInCell);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

Same methods

MyVoxelMap::RemoveContent ( string materialName, string replaceFillMaterial ) : void

Usage Example

Ejemplo n.º 1
0
 public static void StripMaterial(string loadFile, string saveFile, string defaultMaterial, string stripMaterial, string replaceFillMaterial)
 {
     var voxelMap = new MyVoxelMap();
     voxelMap.Load(loadFile, defaultMaterial);
     voxelMap.RemoveContent(stripMaterial, replaceFillMaterial);
     voxelMap.Save(saveFile);
 }
All Usage Examples Of SEToolbox.Interop.Asteroids.MyVoxelMap::RemoveContent