Ejemplo n.º 1
0
 /// <summary>
 /// Generate the given set of voxeldata at the given location offset
 /// </summary>
 /// <param name="location">The xyz to use as an offset for generating these voxels</param>
 /// <param name="voxelData">The voxel data to populate</param>
 public void generateAllAt(Coordinate location, IVoxelStorage voxelData)
 {
     Coordinate.Zero.until(voxelData.bounds, (coordinate) => {
         VoxelsGenerated++;
         Coordinate globalLocation = coordinate + (location * voxelData.bounds);
         float noiseValue          = getNoiseValueAt(globalLocation);
         Voxel.Type newVoxelType   = getVoxelTypeFor(noiseValue, globalLocation);
         if (newVoxelType != Voxel.Types.Empty)
         {
             voxelData.set(coordinate, newVoxelType);
         }
     });
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Generate the given set of voxeldata at the given location offset
 /// </summary>
 /// <param name="location">The xyz to use as an offset for generating these voxels</param>
 /// <param name="voxelData">The voxel data to populate</param>
 public void generateAllAt(Coordinate location, IVoxelStorage voxelData)
 {
     isoSurfaceLevel = getIsoSurfaceLevel();
     Coordinate.Zero.until(voxelData.bounds, (coordinate) => {
         VoxelsGenerated++;
         Coordinate globalLocation    = coordinate + (location * voxelData.bounds);
         float isoSurfaceDensityValue = getNoiseValueAt(globalLocation);
         Voxel.Type newVoxelType      = getVoxelTypeFor(isoSurfaceDensityValue);
         if (newVoxelType != Terrain.Types.Air)
         {
             voxelData.set(coordinate, newVoxelType);
         }
     });
 }
 /// <summary>
 /// Overwrite the entire voxel at the given location
 /// </summary>
 /// <param name="location">the x,y,z of the voxel to set</param>
 /// <param name="newVoxelType">the new type to set for the given voxel</param>
 public void set(Coordinate location, Voxel.Type newVoxelType)
 {
     set(location, newVoxelType.Id);
 }
Ejemplo n.º 4
0
 public void SetVoxel(Pos pos, Voxel.Type type, Color32 color)
 {
     SetVoxel(pos.x, pos.y, pos.z, type, color);
 }
Ejemplo n.º 5
0
 public void SetVoxel(int x, int y, int z, Voxel.Type type, Color32 color)
 {
     voxels[x, y, z].type  = type;
     voxels[x, y, z].color = color;
 }
Ejemplo n.º 6
0
        public void SetVoxel(Pos pos, Voxel.Type type, Color32 color)
        {
//			colorTexture.AddColor(color);
            chunk.SetVoxel(pos, type, color);
            Refresh();
        }