diff options
author | UbitUmarov | 2015-09-01 14:54:35 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-01 14:54:35 +0100 |
commit | 371c9dd2af01a2e7422ec901ee1f80757284a78c (patch) | |
tree | 058d2a513cacb12efcce0c0df0ae14ad135dbfe2 /OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs | |
parent | remove lixo (diff) | |
parent | dont change camera on crossings (diff) | |
download | opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.zip opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.gz opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.bz2 opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.xz |
bad merge?
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs index bd9a8a0..1b704bb 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs | |||
@@ -35,38 +35,22 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
35 | #region ITerrainPaintableEffect Members | 35 | #region ITerrainPaintableEffect Members |
36 | 36 | ||
37 | 37 | ||
38 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, double strength, double duration) | 38 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, |
39 | double strength, double duration, int startX, int endX, int startY, int endY) | ||
39 | { | 40 | { |
40 | int s = (int) (Math.Pow(2, strength) + 0.5); | 41 | int s = (int) (Math.Pow(2, strength) + 0.5); |
41 | 42 | ||
42 | int x; | 43 | int x,y; |
43 | int xFrom = (int)(rx-s+0.5); | ||
44 | int xTo = (int)(rx+s+0.5) + 1; | ||
45 | int yFrom = (int)(ry-s+0.5); | ||
46 | int yTo = (int)(ry+s+0.5) + 1; | ||
47 | 44 | ||
48 | if (xFrom < 0) | 45 | for (x = startX; x <= endX; x++) |
49 | xFrom = 0; | ||
50 | |||
51 | if (yFrom < 0) | ||
52 | yFrom = 0; | ||
53 | |||
54 | if (xTo > map.Width) | ||
55 | xTo = map.Width; | ||
56 | |||
57 | if (yTo > map.Width) | ||
58 | yTo = map.Width; | ||
59 | |||
60 | for (x = xFrom; x < xTo; x++) | ||
61 | { | 46 | { |
62 | int y; | 47 | for (y = startY; y <= endY; y++) |
63 | for (y = yFrom; y < yTo; y++) | ||
64 | { | 48 | { |
65 | if (!mask[x,y]) | 49 | if (!mask[x, y]) |
66 | continue; | 50 | continue; |
67 | 51 | ||
68 | // Calculate a cos-sphere and add it to the heighmap | 52 | // Calculate a cos-sphere and add it to the heighmap |
69 | double r = Math.Sqrt((x-rx) * (x-rx) + ((y-ry) * (y-ry))); | 53 | double r = Math.Sqrt((x - rx) * (x - rx) + ((y - ry) * (y - ry))); |
70 | double z = Math.Cos(r * Math.PI / (s * 2)); | 54 | double z = Math.Cos(r * Math.PI / (s * 2)); |
71 | if (z > 0.0) | 55 | if (z > 0.0) |
72 | map[x, y] += z * duration; | 56 | map[x, y] += z * duration; |