diff options
Diffstat (limited to 'OpenSim/OpenSim.Region')
-rw-r--r-- | OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs b/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs index 75fe779..01e38d5 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs | |||
@@ -41,25 +41,62 @@ namespace OpenSim.Region.Scenes | |||
41 | public partial class Scene | 41 | public partial class Scene |
42 | { | 42 | { |
43 | /// <summary> | 43 | /// <summary> |
44 | /// | 44 | /// Modifies terrain using the specified information |
45 | /// </summary> | 45 | /// </summary> |
46 | /// <param name="action"></param> | 46 | /// <param name="height">The height at which the user started modifying the terrain</param> |
47 | /// <param name="north"></param> | 47 | /// <param name="seconds">The number of seconds the modify button was pressed</param> |
48 | /// <param name="west"></param> | 48 | /// <param name="brushsize">The size of the brush used</param> |
49 | public void ModifyTerrain(byte action, float north, float west) | 49 | /// <param name="action">The action to be performed</param> |
50 | /// <param name="north">Distance from the north border where the cursor is located</param> | ||
51 | /// <param name="west">Distance from the west border where the cursor is located</param> | ||
52 | public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west) | ||
50 | { | 53 | { |
54 | // Shiny. | ||
55 | double size = (double)(1 << brushsize); | ||
56 | |||
51 | switch (action) | 57 | switch (action) |
52 | { | 58 | { |
59 | case 0: | ||
60 | // flatten terrain | ||
61 | Terrain.flatten(north, west, size, (double)seconds / 100.0); | ||
62 | RegenerateTerrain(true, (int)north, (int)west); | ||
63 | break; | ||
53 | case 1: | 64 | case 1: |
54 | // raise terrain | 65 | // raise terrain |
55 | Terrain.raise(north, west, 10.0, 0.001); | 66 | Terrain.raise(north, west, size, (double)seconds / 100.0); |
56 | RegenerateTerrain(true, (int)north, (int)west); | 67 | RegenerateTerrain(true, (int)north, (int)west); |
57 | break; | 68 | break; |
58 | case 2: | 69 | case 2: |
59 | //lower terrain | 70 | //lower terrain |
60 | Terrain.lower(north, west, 10.0, 0.001); | 71 | Terrain.lower(north, west, size, (double)seconds / 100.0); |
72 | RegenerateTerrain(true, (int)north, (int)west); | ||
73 | break; | ||
74 | case 3: | ||
75 | // smooth terrain | ||
76 | Terrain.smooth(north, west, size, (double)seconds / 100.0); | ||
77 | RegenerateTerrain(true, (int)north, (int)west); | ||
78 | break; | ||
79 | case 4: | ||
80 | // noise | ||
81 | Terrain.noise(north, west, size, (double)seconds / 100.0); | ||
82 | RegenerateTerrain(true, (int)north, (int)west); | ||
83 | break; | ||
84 | case 5: | ||
85 | // revert | ||
86 | Terrain.revert(north, west, size, (double)seconds / 100.0); | ||
61 | RegenerateTerrain(true, (int)north, (int)west); | 87 | RegenerateTerrain(true, (int)north, (int)west); |
62 | break; | 88 | break; |
89 | |||
90 | // CLIENT EXTENSIONS GO HERE | ||
91 | case 128: | ||
92 | // erode-thermal | ||
93 | break; | ||
94 | case 129: | ||
95 | // erode-aerobic | ||
96 | break; | ||
97 | case 130: | ||
98 | // erode-hydraulic | ||
99 | break; | ||
63 | } | 100 | } |
64 | return; | 101 | return; |
65 | } | 102 | } |