aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Terrain.BasicTerrain/Normalise.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim.Terrain.BasicTerrain/Normalise.cs')
-rw-r--r--OpenSim.Terrain.BasicTerrain/Normalise.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenSim.Terrain.BasicTerrain/Normalise.cs b/OpenSim.Terrain.BasicTerrain/Normalise.cs
index 507795b..0d37f44 100644
--- a/OpenSim.Terrain.BasicTerrain/Normalise.cs
+++ b/OpenSim.Terrain.BasicTerrain/Normalise.cs
@@ -6,6 +6,10 @@ namespace OpenSim.Terrain.BasicTerrain
6{ 6{
7 static class Normalise 7 static class Normalise
8 { 8 {
9 /// <summary>
10 /// Converts the heightmap to values ranging from 0..1
11 /// </summary>
12 /// <param name="map">The heightmap to be normalised</param>
9 public static void normalise(float[,] map) 13 public static void normalise(float[,] map)
10 { 14 {
11 double max = findMax(map); 15 double max = findMax(map);
@@ -24,6 +28,11 @@ namespace OpenSim.Terrain.BasicTerrain
24 } 28 }
25 } 29 }
26 30
31 /// <summary>
32 /// Converts the heightmap to values ranging from 0..<newmax>
33 /// </summary>
34 /// <param name="map">The heightmap to be normalised</param>
35 /// <param name="newmax">The new maximum height value of the map</param>
27 public static void normalise(float[,] map, double newmax) 36 public static void normalise(float[,] map, double newmax)
28 { 37 {
29 double max = findMax(map); 38 double max = findMax(map);
@@ -42,6 +51,11 @@ namespace OpenSim.Terrain.BasicTerrain
42 } 51 }
43 } 52 }
44 53
54 /// <summary>
55 /// Finds the largest value in the heightmap
56 /// </summary>
57 /// <param name="map">The heightmap</param>
58 /// <returns>The highest value</returns>
45 public static double findMax(float[,] map) 59 public static double findMax(float[,] map)
46 { 60 {
47 int x, y; 61 int x, y;
@@ -61,6 +75,11 @@ namespace OpenSim.Terrain.BasicTerrain
61 return max; 75 return max;
62 } 76 }
63 77
78 /// <summary>
79 /// Finds the lowest value in a heightmap
80 /// </summary>
81 /// <param name="map">The heightmap</param>
82 /// <returns>The minimum value</returns>
64 public static double findMin(float[,] map) 83 public static double findMin(float[,] map)
65 { 84 {
66 int x, y; 85 int x, y;