aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Terrain.BasicTerrain/Normalise.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-04-07 17:30:11 +0000
committerAdam Frisby2007-04-07 17:30:11 +0000
commitc070d2bbf3eca682166d9e1875aff194c61c3154 (patch)
treefa88ec114052d660efe30b6cfbecd86007b65154 /OpenSim.Terrain.BasicTerrain/Normalise.cs
parentTerrain can now import from a specially formatted file. (diff)
downloadopensim-SC_OLD-c070d2bbf3eca682166d9e1875aff194c61c3154.zip
opensim-SC_OLD-c070d2bbf3eca682166d9e1875aff194c61c3154.tar.gz
opensim-SC_OLD-c070d2bbf3eca682166d9e1875aff194c61c3154.tar.bz2
opensim-SC_OLD-c070d2bbf3eca682166d9e1875aff194c61c3154.tar.xz
ZOMG Comments!
Diffstat (limited to '')
-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;