aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorCharles Krinke2009-03-05 04:24:22 +0000
committerCharles Krinke2009-03-05 04:24:22 +0000
commit62eaddbe14e0bf5098808294502c14a7ed4063c3 (patch)
tree66f40f6c448d4f8fd1700160aee2c0cfe2e3ab79 /OpenSim/Region/ScriptEngine/Shared/Api
parentFixes Mantis #3194. Thank you kindly, Godfrey for a patch that: (diff)
downloadopensim-SC_OLD-62eaddbe14e0bf5098808294502c14a7ed4063c3.zip
opensim-SC_OLD-62eaddbe14e0bf5098808294502c14a7ed4063c3.tar.gz
opensim-SC_OLD-62eaddbe14e0bf5098808294502c14a7ed4063c3.tar.bz2
opensim-SC_OLD-62eaddbe14e0bf5098808294502c14a7ed4063c3.tar.xz
Fixes Mantis #3255. Thank you kindly, MCortez, for a patch that:
Changes to IWindModule interface: Change from assuming a single array of 256 Vector2 values to a lookup function that takes region x, y, z and returns a Vector3 * Changed llWind() to use new lookup method of IWindModule * Moved logic for determining the wind at a given point in the data array from llWind() to the Wind Module itself.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
1 files changed, 8 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index fcd94a4..32ebc37 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1031,17 +1031,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1031 m_host.AddScriptLPS(1); 1031 m_host.AddScriptLPS(1);
1032 LSL_Vector wind = new LSL_Vector(0, 0, 0); 1032 LSL_Vector wind = new LSL_Vector(0, 0, 0);
1033 IWindModule module = World.RequestModuleInterface<IWindModule>(); 1033 IWindModule module = World.RequestModuleInterface<IWindModule>();
1034 if (module != null && module.WindSpeeds != null) 1034 if (module != null)
1035 { 1035 {
1036 Vector3 pos = m_host.GetWorldPosition(); 1036 Vector3 pos = m_host.GetWorldPosition();
1037 int x = (int)((pos.X + offset.x)/ 16); 1037 int x = (int)(pos.X + offset.x);
1038 int y = (int)((pos.Y + offset.y)/ 16); 1038 int y = (int)(pos.Y + offset.y);
1039 if (x < 0) x = 0; 1039
1040 if (x > 15) x = 15; 1040 Vector3 windSpeed = module.WindSpeed(x, y, 0);
1041 if (y < 0) y = 0; 1041
1042 if (y > 15) y = 15; 1042 wind.x = windSpeed.X;
1043 wind.x = module.WindSpeeds[y * 16 + x].X; 1043 wind.y = windSpeed.Y;
1044 wind.y = module.WindSpeeds[y * 16 + x].Y;
1045 } 1044 }
1046 return wind; 1045 return wind;
1047 } 1046 }