aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Region/Scenes
diff options
context:
space:
mode:
authorAdam Frisby2007-06-20 21:57:22 +0000
committerAdam Frisby2007-06-20 21:57:22 +0000
commit8194d822301481c56c2e48857e6609409613dd6d (patch)
treeb2036fe5cc82334623810c67bee7b0da180ba231 /OpenSim/OpenSim.Region/Scenes
parent* Bonus commit: "terrain save" now supports a 'PNG' method. (diff)
downloadopensim-SC_OLD-8194d822301481c56c2e48857e6609409613dd6d.zip
opensim-SC_OLD-8194d822301481c56c2e48857e6609409613dd6d.tar.gz
opensim-SC_OLD-8194d822301481c56c2e48857e6609409613dd6d.tar.bz2
opensim-SC_OLD-8194d822301481c56c2e48857e6609409613dd6d.tar.xz
* Terrain modification more robust, uses area sizes matching those employed by the client display.
* Terrain tools now account for the duration the cursor was held for. * Terrain tools now support new brushes (completing the common set) ** Smooth brush ** Flatten brush ** Revert brush ** Noise brush
Diffstat (limited to 'OpenSim/OpenSim.Region/Scenes')
-rw-r--r--OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs51
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 }