aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-03-05 21:10:39 +0000
committerJustin Clarke Casey2009-03-05 21:10:39 +0000
commit11e1948b57f96e7d22c56e82bfb15b93f62a5cef (patch)
tree854a974e8a9870b7070c28b070f62557d98e13a5 /OpenSim
parent* refactor: move media and music url setting from scene into LandObject (diff)
downloadopensim-SC-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.zip
opensim-SC-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.tar.gz
opensim-SC-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.tar.bz2
opensim-SC-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.tar.xz
* Replace Scene.GetLandHeight() with a straight query to Scene.Heightmap (which is used in other contexts)
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs21
5 files changed, 13 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
index 67cc1a1..edd1804 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
@@ -88,7 +88,8 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
88 } 88 }
89 // TODO: Get proper AVG Height 89 // TODO: Get proper AVG Height
90 float localAVHeight = 1.56f; 90 float localAVHeight = 1.56f;
91 float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y); 91
92 float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y];
92 float newPosZ = posZLimit + localAVHeight; 93 float newPosZ = posZLimit + localAVHeight;
93 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 94 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
94 { 95 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7776215..aa0218b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3019,11 +3019,6 @@ namespace OpenSim.Region.Framework.Scenes
3019 m_eventManager.TriggerOnPluginConsole(args); 3019 m_eventManager.TriggerOnPluginConsole(args);
3020 } 3020 }
3021 3021
3022 public double GetLandHeight(int x, int y)
3023 {
3024 return Heightmap[x, y];
3025 }
3026
3027 public UUID GetLandOwner(float x, float y) 3022 public UUID GetLandOwner(float x, float y)
3028 { 3023 {
3029 ILandObject land = LandChannel.GetLandObject(x, y); 3024 ILandObject land = LandChannel.GetLandObject(x, y);
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index c3b60f8..28ea8b0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -710,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
710 710
711 // TODO: Get proper AVG Height 711 // TODO: Get proper AVG Height
712 float localAVHeight = 1.56f; 712 float localAVHeight = 1.56f;
713 float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y); 713 float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y];
714 float newPosZ = posZLimit + localAVHeight; 714 float newPosZ = posZLimit + localAVHeight;
715 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 715 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
716 { 716 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6eb6ea4..67f6c29 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -848,7 +848,7 @@ namespace OpenSim.Region.Framework.Scenes
848 localAVHeight = m_avHeight; 848 localAVHeight = m_avHeight;
849 } 849 }
850 850
851 float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); 851 float posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y];
852 float newPosZ = posZLimit + localAVHeight / 2; 852 float newPosZ = posZLimit + localAVHeight / 2;
853 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 853 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
854 { 854 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5be967e..fad456f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1007,17 +1007,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1007 int y = (int)(pos.Y + offset.y); 1007 int y = (int)(pos.Y + offset.y);
1008 1008
1009 // Clamp to valid position 1009 // Clamp to valid position
1010 if (x<0) 1010 if (x < 0)
1011 x = 0; 1011 x = 0;
1012 else if (x>=World.Heightmap.Width) 1012 else if (x >= World.Heightmap.Width)
1013 x = World.Heightmap.Width-1; 1013 x = World.Heightmap.Width - 1;
1014 if (y<0) 1014 if (y < 0)
1015 y = 0; 1015 y = 0;
1016 else if (y>=World.Heightmap.Height) 1016 else if (y >= World.Heightmap.Height)
1017 y = World.Heightmap.Height-1; 1017 y = World.Heightmap.Height - 1;
1018 1018
1019 1019 return World.Heightmap[x, y];
1020 return World.GetLandHeight(x, y);
1021 } 1020 }
1022 1021
1023 public LSL_Float llCloud(LSL_Vector offset) 1022 public LSL_Float llCloud(LSL_Vector offset)
@@ -2794,15 +2793,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2794 } 2793 }
2795 } 2794 }
2796 2795
2797
2798
2799 public void llSetHoverHeight(double height, int water, double tau) 2796 public void llSetHoverHeight(double height, int water, double tau)
2800 { 2797 {
2801 m_host.AddScriptLPS(1); 2798 m_host.AddScriptLPS(1);
2802 Vector3 pos = m_host.GetWorldPosition(); 2799 Vector3 pos = m_host.GetWorldPosition();
2803 int x = (int)(pos.X); 2800 int x = (int)(pos.X);
2804 int y = (int)(pos.Y); 2801 int y = (int)(pos.Y);
2805 float landHeight = (float)World.GetLandHeight(x, y); 2802 float landHeight = (float)World.Heightmap[x, y];
2806 float targetHeight = landHeight + (float)height; 2803 float targetHeight = landHeight + (float)height;
2807 if (water == 1) 2804 if (water == 1)
2808 { 2805 {