aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs65
1 files changed, 33 insertions, 32 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
index 6cbd390..9bfb981 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
@@ -37,38 +37,39 @@ namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes
37 return z; 37 return z;
38 } 38 }
39 39
40 private double GetBilinearInterpolate(double x, double y, ITerrainChannel map) 40// TODO: unused
41 { 41// private double GetBilinearInterpolate(double x, double y, ITerrainChannel map)
42 int w = map.Width; 42// {
43 int h = map.Height; 43// int w = map.Width;
44 44// int h = map.Height;
45 if (x > w - 2.0) 45
46 x = w - 2.0; 46// if (x > w - 2.0)
47 if (y > h - 2.0) 47// x = w - 2.0;
48 y = h - 2.0; 48// if (y > h - 2.0)
49 if (x < 0.0) 49// y = h - 2.0;
50 x = 0.0; 50// if (x < 0.0)
51 if (y < 0.0) 51// x = 0.0;
52 y = 0.0; 52// if (y < 0.0)
53 53// y = 0.0;
54 int stepSize = 1; 54
55 double h00 = map[(int)x, (int)y]; 55// int stepSize = 1;
56 double h10 = map[(int)x + stepSize, (int)y]; 56// double h00 = map[(int)x, (int)y];
57 double h01 = map[(int)x, (int)y + stepSize]; 57// double h10 = map[(int)x + stepSize, (int)y];
58 double h11 = map[(int)x + stepSize, (int)y + stepSize]; 58// double h01 = map[(int)x, (int)y + stepSize];
59 double h1 = h00; 59// double h11 = map[(int)x + stepSize, (int)y + stepSize];
60 double h2 = h10; 60// double h1 = h00;
61 double h3 = h01; 61// double h2 = h10;
62 double h4 = h11; 62// double h3 = h01;
63 double a00 = h1; 63// double h4 = h11;
64 double a10 = h2 - h1; 64// double a00 = h1;
65 double a01 = h3 - h1; 65// double a10 = h2 - h1;
66 double a11 = h1 - h2 - h3 + h4; 66// double a01 = h3 - h1;
67 double partialx = x - (int)x; 67// double a11 = h1 - h2 - h3 + h4;
68 double partialz = y - (int)y; 68// double partialx = x - (int)x;
69 double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz); 69// double partialz = y - (int)y;
70 return hi; 70// double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz);
71 } 71// return hi;
72// }
72 73
73 #region ITerrainPaintableEffect Members 74 #region ITerrainPaintableEffect Members
74 75