コード例 #1
0
        public void GenerateTerrainVertices(FluidBlock block, BlockGeometryGenerator generator, TerrainGeometrySubsets geometry, int value, int x, int y, int z)
        {
            int data = Terrain.ExtractData(value);

            if (true)
            {
                Terrain terrain        = generator.Terrain;
                int     cellValueFast  = terrain.GetCellValueFast(x - 1, y, z - 1);
                int     cellValueFast2 = terrain.GetCellValueFast(x, y, z - 1);
                int     cellValueFast3 = terrain.GetCellValueFast(x + 1, y, z - 1);
                int     cellValueFast4 = terrain.GetCellValueFast(x - 1, y, z);
                int     cellValueFast5 = terrain.GetCellValueFast(x + 1, y, z);
                int     cellValueFast6 = terrain.GetCellValueFast(x - 1, y, z + 1);
                int     cellValueFast7 = terrain.GetCellValueFast(x, y, z + 1);
                int     cellValueFast8 = terrain.GetCellValueFast(x + 1, y, z + 1);
                float   h           = CalculateNeighborHeight(cellValueFast);
                float   num         = CalculateNeighborHeight(cellValueFast2);
                float   h2          = CalculateNeighborHeight(cellValueFast3);
                float   num2        = CalculateNeighborHeight(cellValueFast4);
                float   num3        = CalculateNeighborHeight(cellValueFast5);
                float   h3          = CalculateNeighborHeight(cellValueFast6);
                float   num4        = CalculateNeighborHeight(cellValueFast7);
                float   h4          = CalculateNeighborHeight(cellValueFast8);
                float   levelHeight = GetLevelHeight(GetLevel(data));
                float   height      = CalculateFluidVertexHeight(h, num, num2, levelHeight);
                float   height2     = CalculateFluidVertexHeight(num, h2, levelHeight, num3);
                float   height3     = CalculateFluidVertexHeight(levelHeight, num3, num4, h4);
                float   height4     = CalculateFluidVertexHeight(num2, levelHeight, h3, num4);
                generator.GenerateCubeVertices(block, value, x, y, z, height, height2, height3, height4, sidecolor, topcolor, topcolor, topcolor, topcolor, 255, SubsystemItemBlockBase.GTV(x, z, geometry).OpaqueSubsetsByFace);
            }
            else
            {
                generator.GenerateCubeVertices(block, value, x, y, z, sidecolor, SubsystemItemBlockBase.GTV(x, z, geometry).OpaqueSubsetsByFace);
            }
        }
コード例 #2
0
 public override void GenerateTerrainVertices(Block block, BlockGeometryGenerator generator, TerrainGeometrySubsets geometry, int value, int x, int y, int z)
 {
     generator.GenerateCubeVertices(block, value, x, y, z, Color.White, SubsystemItemBlockBase.GTV(x, z, geometry).OpaqueSubsetsByFace);
 }