Exemple #1
0
        public void SmoothTerrain(int iterations)
        {
            float[,] heightmap = GetTerrainHeight();

            Smooth.Apply(heightmap, iterations);

            UpdateTerrainHeight(heightmap);
        }
Exemple #2
0
        public void Smooth_ShouldBeEqualSmoothedHeighmap(string originalHeightmap, string smoothedHeightmap)
        {
            // Arrange
            float[,] actualHeighmap   = ReadHeightMap(originalHeightmap);
            float[,] expectedHeighmap = ReadHeightMap(smoothedHeightmap);

            // Act
            Smooth.Apply(actualHeighmap, iterations);

            // Assert
            AreEqual(actualHeighmap, expectedHeighmap, allowedDifference).Should().Be(true);
        }