aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-07-23 05:29:52 +0000
committerAdam Frisby2007-07-23 05:29:52 +0000
commitb8da9c3a64b84ab14642bad8c79d3b2ed62e62fb (patch)
treede4466ffdf017e140ec3aca9bb52cbe14e5e5b12 /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
parentCouple of small changes (diff)
downloadopensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.zip
opensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.gz
opensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.bz2
opensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.xz
* Major style changes in libTerrain.Channel - now uses .NET-style naming syntax.
* Issue#218 - Updated mySQL region table.
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs42
1 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
index d56f7a5..0d6d0fc 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
@@ -35,23 +35,23 @@ namespace libTerrain
35{ 35{
36 public partial class Channel 36 public partial class Channel
37 { 37 {
38 public int getWidth() 38 public int GetWidth()
39 { 39 {
40 return w; 40 return w;
41 } 41 }
42 public int getHeight() 42 public int GetHeight()
43 { 43 {
44 return h; 44 return h;
45 } 45 }
46 46
47 public Channel copy() 47 public Channel Copy()
48 { 48 {
49 Channel x = new Channel(w, h); 49 Channel x = new Channel(w, h);
50 x.map = (double[,])this.map.Clone(); 50 x.map = (double[,])this.map.Clone();
51 return x; 51 return x;
52 } 52 }
53 53
54 public void set(int x, int y, double val) 54 public void Set(int x, int y, double val)
55 { 55 {
56 if (x >= w) 56 if (x >= w)
57 throw new Exception("Bounds error while setting pixel (width)"); 57 throw new Exception("Bounds error while setting pixel (width)");
@@ -65,7 +65,7 @@ namespace libTerrain
65 map[x, y] = val; 65 map[x, y] = val;
66 } 66 }
67 67
68 public void setClip(int x, int y, double val) 68 public void SetClip(int x, int y, double val)
69 { 69 {
70 if (x >= w) 70 if (x >= w)
71 throw new Exception("Bounds error while setting pixel (width)"); 71 throw new Exception("Bounds error while setting pixel (width)");
@@ -84,7 +84,7 @@ namespace libTerrain
84 map[x, y] = val; 84 map[x, y] = val;
85 } 85 }
86 86
87 private double getBilinearInterpolate(double x, double y) 87 private double GetBilinearInterpolate(double x, double y)
88 { 88 {
89 if (x > w - 2.0) 89 if (x > w - 2.0)
90 x = w - 2.0; 90 x = w - 2.0;
@@ -95,11 +95,11 @@ namespace libTerrain
95 if (y < 0.0) 95 if (y < 0.0)
96 y = 0.0; 96 y = 0.0;
97 97
98 int STEP_SIZE = 1; 98 int stepSize = 1;
99 double h00 = get((int)x, (int)y); 99 double h00 = Get((int)x, (int)y);
100 double h10 = get((int)x + STEP_SIZE, (int)y); 100 double h10 = Get((int)x + stepSize, (int)y);
101 double h01 = get((int)x, (int)y + STEP_SIZE); 101 double h01 = Get((int)x, (int)y + stepSize);
102 double h11 = get((int)x + STEP_SIZE, (int)y + STEP_SIZE); 102 double h11 = Get((int)x + stepSize, (int)y + stepSize);
103 double h1 = h00; 103 double h1 = h00;
104 double h2 = h10; 104 double h2 = h10;
105 double h3 = h01; 105 double h3 = h01;
@@ -114,7 +114,7 @@ namespace libTerrain
114 return hi; 114 return hi;
115 } 115 }
116 116
117 public double get(int x, int y) 117 public double Get(int x, int y)
118 { 118 {
119 if (x >= w) 119 if (x >= w)
120 x = w - 1; 120 x = w - 1;
@@ -127,12 +127,12 @@ namespace libTerrain
127 return map[x, y]; 127 return map[x, y];
128 } 128 }
129 129
130 public void setWrap(int x, int y, double val) 130 public void SetWrap(int x, int y, double val)
131 { 131 {
132 map[x % w, y % h] = val; 132 map[x % w, y % h] = val;
133 } 133 }
134 134
135 public void setWrapClip(int x, int y, double val) 135 public void SetWrapClip(int x, int y, double val)
136 { 136 {
137 if (val > 1.0) 137 if (val > 1.0)
138 val = 1.0; 138 val = 1.0;
@@ -142,7 +142,7 @@ namespace libTerrain
142 map[x % w, y % h] = val; 142 map[x % w, y % h] = val;
143 } 143 }
144 144
145 public void fill(double val) 145 public void Fill(double val)
146 { 146 {
147 int x, y; 147 int x, y;
148 for (x = 0; x < w; x++) 148 for (x = 0; x < w; x++)
@@ -154,7 +154,7 @@ namespace libTerrain
154 } 154 }
155 } 155 }
156 156
157 public void fill(double min, double max, double val) 157 public void Fill(double min, double max, double val)
158 { 158 {
159 int x, y; 159 int x, y;
160 for (x = 0; x < w; x++) 160 for (x = 0; x < w; x++)
@@ -167,7 +167,7 @@ namespace libTerrain
167 } 167 }
168 } 168 }
169 169
170 public double findMax() 170 public double FindMax()
171 { 171 {
172 int x, y; 172 int x, y;
173 double max = double.MinValue; 173 double max = double.MinValue;
@@ -184,7 +184,7 @@ namespace libTerrain
184 return max; 184 return max;
185 } 185 }
186 186
187 public double findMin() 187 public double FindMin()
188 { 188 {
189 int x, y; 189 int x, y;
190 double min = double.MaxValue; 190 double min = double.MaxValue;
@@ -201,7 +201,7 @@ namespace libTerrain
201 return min; 201 return min;
202 } 202 }
203 203
204 public double sum() 204 public double Sum()
205 { 205 {
206 int x, y; 206 int x, y;
207 double sum = 0.0; 207 double sum = 0.0;
@@ -217,9 +217,9 @@ namespace libTerrain
217 return sum; 217 return sum;
218 } 218 }
219 219
220 public double avg() 220 public double Avg()
221 { 221 {
222 return sum() / (w * h); 222 return Sum() / (w * h);
223 } 223 }
224 } 224 }
225} 225}