diff options
author | Adam Frisby | 2007-07-21 22:20:22 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-21 22:20:22 +0000 |
commit | 4eb8ca49a901b09ce4bc3130f76f53b910391bbc (patch) | |
tree | a8bf71c7dee31f69a26e29e0708317429653fd7c /OpenSim/Region/Environment | |
parent | * Fixed an issue whereby extremely tall terrains would be unable to output a ... (diff) | |
download | opensim-SC_OLD-4eb8ca49a901b09ce4bc3130f76f53b910391bbc.zip opensim-SC_OLD-4eb8ca49a901b09ce4bc3130f76f53b910391bbc.tar.gz opensim-SC_OLD-4eb8ca49a901b09ce4bc3130f76f53b910391bbc.tar.bz2 opensim-SC_OLD-4eb8ca49a901b09ce4bc3130f76f53b910391bbc.tar.xz |
* Renamed terrain functions to match OpenSim naming styles.
* Added capability to support minimum/maximum terrain limits (from the last 'bake')
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/Land.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneBase.cs | 4 |
4 files changed, 25 insertions, 25 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs index b333f36..bae3b0e 100644 --- a/OpenSim/Region/Environment/LandManagement/Land.cs +++ b/OpenSim/Region/Environment/LandManagement/Land.cs | |||
@@ -219,8 +219,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
219 | } | 219 | } |
220 | } | 220 | } |
221 | } | 221 | } |
222 | landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_world.Terrain.get((min_x * 4), (min_y * 4))); | 222 | landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_world.Terrain.GetHeight((min_x * 4), (min_y * 4))); |
223 | landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_world.Terrain.get((max_x * 4), (max_y * 4))); | 223 | landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_world.Terrain.GetHeight((max_x * 4), (max_y * 4))); |
224 | landData.area = tempArea; | 224 | landData.area = tempArea; |
225 | } | 225 | } |
226 | 226 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 9a81a5f..e963737 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -54,32 +54,32 @@ namespace OpenSim.Region.Environment.Scenes | |||
54 | { | 54 | { |
55 | case 0: | 55 | case 0: |
56 | // flatten terrain | 56 | // flatten terrain |
57 | Terrain.flatten(north, west, size, (double)seconds / 5.0); | 57 | Terrain.FlattenTerrain(north, west, size, (double)seconds / 5.0); |
58 | RegenerateTerrain(true, (int)north, (int)west); | 58 | RegenerateTerrain(true, (int)north, (int)west); |
59 | break; | 59 | break; |
60 | case 1: | 60 | case 1: |
61 | // raise terrain | 61 | // raise terrain |
62 | Terrain.raise(north, west, size, (double)seconds / 5.0); | 62 | Terrain.RaiseTerrain(north, west, size, (double)seconds / 5.0); |
63 | RegenerateTerrain(true, (int)north, (int)west); | 63 | RegenerateTerrain(true, (int)north, (int)west); |
64 | break; | 64 | break; |
65 | case 2: | 65 | case 2: |
66 | //lower terrain | 66 | //lower terrain |
67 | Terrain.lower(north, west, size, (double)seconds / 5.0); | 67 | Terrain.LowerTerrain(north, west, size, (double)seconds / 5.0); |
68 | RegenerateTerrain(true, (int)north, (int)west); | 68 | RegenerateTerrain(true, (int)north, (int)west); |
69 | break; | 69 | break; |
70 | case 3: | 70 | case 3: |
71 | // smooth terrain | 71 | // smooth terrain |
72 | Terrain.smooth(north, west, size, (double)seconds / 5.0); | 72 | Terrain.SmoothTerrain(north, west, size, (double)seconds / 5.0); |
73 | RegenerateTerrain(true, (int)north, (int)west); | 73 | RegenerateTerrain(true, (int)north, (int)west); |
74 | break; | 74 | break; |
75 | case 4: | 75 | case 4: |
76 | // noise | 76 | // noise |
77 | Terrain.noise(north, west, size, (double)seconds / 5.0); | 77 | Terrain.NoiseTerrain(north, west, size, (double)seconds / 5.0); |
78 | RegenerateTerrain(true, (int)north, (int)west); | 78 | RegenerateTerrain(true, (int)north, (int)west); |
79 | break; | 79 | break; |
80 | case 5: | 80 | case 5: |
81 | // revert | 81 | // revert |
82 | Terrain.revert(north, west, size, (double)seconds / 5.0); | 82 | Terrain.RevertTerrain(north, west, size, (double)seconds / 5.0); |
83 | RegenerateTerrain(true, (int)north, (int)west); | 83 | RegenerateTerrain(true, (int)north, (int)west); |
84 | break; | 84 | break; |
85 | 85 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index acd7f3f..64676f0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -239,10 +239,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
239 | { | 239 | { |
240 | lock (m_syncRoot) | 240 | lock (m_syncRoot) |
241 | { | 241 | { |
242 | phyScene.SetTerrain(Terrain.getHeights1D()); | 242 | phyScene.SetTerrain(Terrain.GetHeights1D()); |
243 | } | 243 | } |
244 | 244 | ||
245 | storageManager.DataStore.StoreTerrain(Terrain.getHeights2DD()); | 245 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); |
246 | 246 | ||
247 | ForEachScenePresence(delegate(ScenePresence presence) | 247 | ForEachScenePresence(delegate(ScenePresence presence) |
248 | { | 248 | { |
@@ -295,14 +295,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
295 | { | 295 | { |
296 | try | 296 | try |
297 | { | 297 | { |
298 | Terrain.hills(); | 298 | Terrain.HillsGenerator(); |
299 | 299 | ||
300 | lock (m_syncRoot) | 300 | lock (m_syncRoot) |
301 | { | 301 | { |
302 | phyScene.SetTerrain(Terrain.getHeights1D()); | 302 | phyScene.SetTerrain(Terrain.GetHeights1D()); |
303 | } | 303 | } |
304 | 304 | ||
305 | storageManager.DataStore.StoreTerrain(Terrain.getHeights2DD()); | 305 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); |
306 | 306 | ||
307 | ForEachScenePresence(delegate(ScenePresence presence) | 307 | ForEachScenePresence(delegate(ScenePresence presence) |
308 | { | 308 | { |
@@ -328,12 +328,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
328 | { | 328 | { |
329 | try | 329 | try |
330 | { | 330 | { |
331 | Terrain.setHeights2D(newMap); | 331 | Terrain.SetHeights2D(newMap); |
332 | lock (m_syncRoot) | 332 | lock (m_syncRoot) |
333 | { | 333 | { |
334 | phyScene.SetTerrain(Terrain.getHeights1D()); | 334 | phyScene.SetTerrain(Terrain.GetHeights1D()); |
335 | } | 335 | } |
336 | storageManager.DataStore.StoreTerrain(Terrain.getHeights2DD()); | 336 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); |
337 | 337 | ||
338 | ForEachScenePresence(delegate(ScenePresence presence) | 338 | ForEachScenePresence(delegate(ScenePresence presence) |
339 | { | 339 | { |
@@ -395,28 +395,28 @@ namespace OpenSim.Region.Environment.Scenes | |||
395 | if (string.IsNullOrEmpty(m_regInfo.estateSettings.terrainFile)) | 395 | if (string.IsNullOrEmpty(m_regInfo.estateSettings.terrainFile)) |
396 | { | 396 | { |
397 | Console.WriteLine("No default terrain, procedurally generating..."); | 397 | Console.WriteLine("No default terrain, procedurally generating..."); |
398 | Terrain.hills(); | 398 | Terrain.HillsGenerator(); |
399 | 399 | ||
400 | storageManager.DataStore.StoreTerrain(Terrain.getHeights2DD()); | 400 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); |
401 | } | 401 | } |
402 | else | 402 | else |
403 | { | 403 | { |
404 | try | 404 | try |
405 | { | 405 | { |
406 | Terrain.loadFromFileF32(m_regInfo.estateSettings.terrainFile); | 406 | Terrain.LoadFromFileF32(m_regInfo.estateSettings.terrainFile); |
407 | Terrain *= m_regInfo.estateSettings.terrainMultiplier; | 407 | Terrain *= m_regInfo.estateSettings.terrainMultiplier; |
408 | } | 408 | } |
409 | catch | 409 | catch |
410 | { | 410 | { |
411 | Console.WriteLine("Unable to load default terrain, procedurally generating instead..."); | 411 | Console.WriteLine("Unable to load default terrain, procedurally generating instead..."); |
412 | Terrain.hills(); | 412 | Terrain.HillsGenerator(); |
413 | } | 413 | } |
414 | storageManager.DataStore.StoreTerrain(Terrain.getHeights2DD()); | 414 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); |
415 | } | 415 | } |
416 | } | 416 | } |
417 | else | 417 | else |
418 | { | 418 | { |
419 | Terrain.setHeights2D(map); | 419 | Terrain.SetHeights2D(map); |
420 | } | 420 | } |
421 | 421 | ||
422 | CreateTerrainTexture(); | 422 | CreateTerrainTexture(); |
@@ -433,7 +433,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
433 | public void CreateTerrainTexture() | 433 | public void CreateTerrainTexture() |
434 | { | 434 | { |
435 | //create a texture asset of the terrain | 435 | //create a texture asset of the terrain |
436 | byte[] data = Terrain.exportJpegImage("defaultstripe.png"); | 436 | byte[] data = Terrain.ExportJpegImage("defaultstripe.png"); |
437 | m_regInfo.estateSettings.terrainImageID = LLUUID.Random(); | 437 | m_regInfo.estateSettings.terrainImageID = LLUUID.Random(); |
438 | AssetBase asset = new AssetBase(); | 438 | AssetBase asset = new AssetBase(); |
439 | asset.FullID = m_regInfo.estateSettings.terrainImageID; | 439 | asset.FullID = m_regInfo.estateSettings.terrainImageID; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index f3db9e2..c91c654 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
81 | /// <param name="RemoteClient">Client to send to</param> | 81 | /// <param name="RemoteClient">Client to send to</param> |
82 | public virtual void SendLayerData(IClientAPI RemoteClient) | 82 | public virtual void SendLayerData(IClientAPI RemoteClient) |
83 | { | 83 | { |
84 | RemoteClient.SendLayerData(Terrain.getHeights1D()); | 84 | RemoteClient.SendLayerData(Terrain.GetHeights1D()); |
85 | } | 85 | } |
86 | 86 | ||
87 | /// <summary> | 87 | /// <summary> |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
92 | /// <param name="RemoteClient">The client to send to</param> | 92 | /// <param name="RemoteClient">The client to send to</param> |
93 | public virtual void SendLayerData(int px, int py, IClientAPI RemoteClient) | 93 | public virtual void SendLayerData(int px, int py, IClientAPI RemoteClient) |
94 | { | 94 | { |
95 | RemoteClient.SendLayerData(px, py, Terrain.getHeights1D()); | 95 | RemoteClient.SendLayerData(px, py, Terrain.GetHeights1D()); |
96 | } | 96 | } |
97 | 97 | ||
98 | #endregion | 98 | #endregion |