コード例 #1
0
ファイル: TerrainMesh.cs プロジェクト: apeape/GameClient
 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);
 }
コード例 #2
0
ファイル: TerrainManager.cs プロジェクト: apeape/GameClient
 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];
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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.");
        }
コード例 #5
0
 public void SetCell(int X, int Y, int Z, VolumeDensity8 volume)
 {
     terrainCells[X, Y, Z] = volume;
 }
コード例 #6
0
 public void SetCell(float X, float Y, float Z, VolumeDensity8 volume)
 {
     SetCell((int)X, (int)Y, (int)Z, volume);
 }
コード例 #7
0
 public void SetCell(Vector3 cell, VolumeDensity8 volume)
 {
     SetCell(cell.X, cell.Y, cell.Z, volume);
 }
コード例 #8
0
 public TerrainCellMesh(VolumeDensity8 volume, Vector3 pos)
     : this(volume, pos, TerrainManager.defaultCellScale)
 {
 }