public TerrainCellMesh(VolumeDensity8 volume, Vector3 pos) { surface = new SurfaceMeshPositionMaterialNormal(); Position = pos; volume.setBorderValue(new Density8(0)); surfaceExtractor = new SurfaceExtractorDensity8(volume, volume.getEntireVolumePaddedBorder(), surface); cubicSurfaceExtractor = new CubicSurfaceExtractorWithNormalsDensity8(volume, volume.getEntireVolumePaddedBorder(), surface); }
public TerrainManager(int width, int height, int depth, int cellWidth, int cellHeight, int cellDepth) { Initialized = false; cellsInitialized = 0; terrainDimensions = new Vector3(width, height, depth); this.cellDimensions = new Vector3(cellWidth, cellHeight, cellDepth); terrainCells = new VolumeDensity8[width, height, depth]; terrainCellMeshes = new TerrainCellMesh[width, height, depth]; }
public TerrainCellMesh(VolumeDensity8 volume, Vector3 pos, float scale) { Position = pos; //Setup the world matrix this.worldMatrix = Matrix.CreateScale(scale) * Matrix.CreateRotationY(MathHelper.Pi) * Matrix.CreateTranslation(pos * volume.getWidth()); surface = new SurfaceMeshPositionMaterialNormal(); volume.setBorderValue(new Density8(0)); surfaceExtractor = new SurfaceExtractorDensity8(volume, volume.getEntireVolumePaddedBorder(), surface); cubicSurfaceExtractor = new CubicSurfaceExtractorWithNormalsDensity8(volume, volume.getEntireVolumePaddedBorder(), surface); }
public TerrainManager(int width, int height, int depth, int cellWidth, int cellHeight, int cellDepth) { Initialized = false; cellsInitialized = 0; terrainDimensions = new Vector3(width, height, depth); cellDimensions = new Vector3(cellWidth, cellHeight, cellDepth); terrainCells = new VolumeDensity8[width, height, depth]; terrainCellMeshes = new TerrainCellMesh[width, height, depth]; cubicTerrain = defaultCubicTerrain; cellGap = defaultCellScale; cellGap = cubicTerrain ? defaultCellScale : defaultCellScale + (1 / cellDimensions.X); WireFrame = false; ShowBoundingBoxes = false; terrainShader = new Triplanar(); boundingBoxShader = new MaterialShader(); if (!File.Exists("PolyVoxCore.dll")) throw new FileNotFoundException("Missing PolyVoxCore.dll! Please place it in the same directory as the game executable."); }
public void SetCell(int X, int Y, int Z, VolumeDensity8 volume) { terrainCells[X, Y, Z] = volume; }
public void SetCell(float X, float Y, float Z, VolumeDensity8 volume) { SetCell((int)X, (int)Y, (int)Z, volume); }
public void SetCell(Vector3 cell, VolumeDensity8 volume) { SetCell(cell.X, cell.Y, cell.Z, volume); }
public TerrainCellMesh(VolumeDensity8 volume, Vector3 pos) : this(volume, pos, TerrainManager.defaultCellScale) { }