diff options
author | Tedd Hansen | 2008-01-16 21:21:31 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-01-16 21:21:31 +0000 |
commit | 7fa6646d6f75585d6ad3bd2a7c1c0e873e2fc2a6 (patch) | |
tree | d2c5a51cdaad5db0306120416e763dffbfdaef3d | |
parent | * Fix mantis 345 - it is now possible to duplicate prims directly in the regi... (diff) | |
download | opensim-SC-7fa6646d6f75585d6ad3bd2a7c1c0e873e2fc2a6.zip opensim-SC-7fa6646d6f75585d6ad3bd2a7c1c0e873e2fc2a6.tar.gz opensim-SC-7fa6646d6f75585d6ad3bd2a7c1c0e873e2fc2a6.tar.bz2 opensim-SC-7fa6646d6f75585d6ad3bd2a7c1c0e873e2fc2a6.tar.xz |
Added (experimental) terrain elevate command to allow whole terrain to be elevated with positive or negative values
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Grid.cs | 18 |
2 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index 2405e86..fdbbb5e 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | |||
@@ -477,6 +477,7 @@ namespace OpenSim.Region.Terrain | |||
477 | resultText += "terrain erode thermal <talus> <rounds> <carry>\n"; | 477 | resultText += "terrain erode thermal <talus> <rounds> <carry>\n"; |
478 | resultText += "terrain erode hydraulic <rain> <evaporation> <solubility> <frequency> <rounds>\n"; | 478 | resultText += "terrain erode hydraulic <rain> <evaporation> <solubility> <frequency> <rounds>\n"; |
479 | resultText += "terrain multiply <val> - multiplies a terrain by <val>\n"; | 479 | resultText += "terrain multiply <val> - multiplies a terrain by <val>\n"; |
480 | resultText += "terrain elevate <val> - elevates a terrain by <val>\n"; | ||
480 | resultText += "terrain revert - reverts the terrain to the stored original\n"; | 481 | resultText += "terrain revert - reverts the terrain to the stored original\n"; |
481 | resultText += "terrain bake - saves the current terrain into the revert map\n"; | 482 | resultText += "terrain bake - saves the current terrain into the revert map\n"; |
482 | resultText += | 483 | resultText += |
@@ -524,6 +525,10 @@ namespace OpenSim.Region.Terrain | |||
524 | SetRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2])); | 525 | SetRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2])); |
525 | break; | 526 | break; |
526 | 527 | ||
528 | case "elevate": | ||
529 | Elevate(Convert.ToSingle(args[1])); | ||
530 | break; | ||
531 | |||
527 | case "fill": | 532 | case "fill": |
528 | heightmap.Fill(Convert.ToDouble(args[1])); | 533 | heightmap.Fill(Convert.ToDouble(args[1])); |
529 | tainted++; | 534 | tainted++; |
@@ -766,6 +771,16 @@ namespace OpenSim.Region.Terrain | |||
766 | } | 771 | } |
767 | 772 | ||
768 | /// <summary> | 773 | /// <summary> |
774 | /// Adds meters (positive or negative) to terrain height | ||
775 | /// </summary> | ||
776 | /// <param name="meters">Positive or negative value to add to new array</param> | ||
777 | public void Elevate(float meters) | ||
778 | { | ||
779 | heightmap.Elevate((double)meters); | ||
780 | tainted++; | ||
781 | } | ||
782 | |||
783 | /// <summary> | ||
769 | /// Loads a file consisting of 256x256 doubles and imports it as an array into the map. | 784 | /// Loads a file consisting of 256x256 doubles and imports it as an array into the map. |
770 | /// </summary> | 785 | /// </summary> |
771 | /// <remarks>TODO: Move this to libTerrain itself</remarks> | 786 | /// <remarks>TODO: Move this to libTerrain itself</remarks> |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Grid.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Grid.cs index 4ff8e78..1a86572 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Grid.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Grid.cs | |||
@@ -96,6 +96,24 @@ namespace libTerrain | |||
96 | return this; | 96 | return this; |
97 | } | 97 | } |
98 | 98 | ||
99 | public Channel Elevate(double meters) | ||
100 | { | ||
101 | SetDiff(); | ||
102 | |||
103 | int x, y; | ||
104 | |||
105 | for (x = 0; x < w; x++) | ||
106 | { | ||
107 | for (y = 0; y < h; y++) | ||
108 | { | ||
109 | map[x, y] += meters; | ||
110 | } | ||
111 | } | ||
112 | |||
113 | return this; | ||
114 | } | ||
115 | |||
116 | |||
99 | public Channel Clip() | 117 | public Channel Clip() |
100 | { | 118 | { |
101 | int x, y; | 119 | int x, y; |