diff options
author | Charles Krinke | 2008-10-19 21:11:13 +0000 |
---|---|---|
committer | Charles Krinke | 2008-10-19 21:11:13 +0000 |
commit | a5d945e199a82985f709aea1beaeeda67787ebde (patch) | |
tree | 54aab6a12cbbef2f9b1fa3dd6a212c8b3cd4c0a1 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | * minor: remove mono warnings (diff) | |
download | opensim-SC-a5d945e199a82985f709aea1beaeeda67787ebde.zip opensim-SC-a5d945e199a82985f709aea1beaeeda67787ebde.tar.gz opensim-SC-a5d945e199a82985f709aea1beaeeda67787ebde.tar.bz2 opensim-SC-a5d945e199a82985f709aea1beaeeda67787ebde.tar.xz |
Thank you kindly, Idb for a patch that solves:
llWind always returns a zero vector. In the attached
patch the WindModule has been changed slightly to
make wind data available for llWind
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 956a500..d410a59 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -953,7 +953,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
953 | public LSL_Vector llWind(LSL_Vector offset) | 953 | public LSL_Vector llWind(LSL_Vector offset) |
954 | { | 954 | { |
955 | m_host.AddScriptLPS(1); | 955 | m_host.AddScriptLPS(1); |
956 | return new LSL_Vector(); | 956 | LSL_Vector wind = new LSL_Vector(0, 0, 0); |
957 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | ||
958 | if (module != null && module.WindSpeeds != null) | ||
959 | { | ||
960 | Vector3 pos = m_host.GetWorldPosition(); | ||
961 | int x = (int)((pos.X + offset.x)/ 16); | ||
962 | int y = (int)((pos.Y + offset.y)/ 16); | ||
963 | if (x < 0) x = 0; | ||
964 | if (x > 15) x = 15; | ||
965 | if (y < 0) y = 0; | ||
966 | if (y > 15) y = 15; | ||
967 | wind.x = module.WindSpeeds[y * 16 + x].X; | ||
968 | wind.y = module.WindSpeeds[y * 16 + x].Y; | ||
969 | } | ||
970 | return wind; | ||
957 | } | 971 | } |
958 | 972 | ||
959 | public void llSetStatus(int status, int value) | 973 | public void llSetStatus(int status, int value) |