From 62eaddbe14e0bf5098808294502c14a7ed4063c3 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Thu, 5 Mar 2009 04:24:22 +0000 Subject: 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. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') 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 m_host.AddScriptLPS(1); LSL_Vector wind = new LSL_Vector(0, 0, 0); IWindModule module = World.RequestModuleInterface(); - if (module != null && module.WindSpeeds != null) + if (module != null) { Vector3 pos = m_host.GetWorldPosition(); - int x = (int)((pos.X + offset.x)/ 16); - int y = (int)((pos.Y + offset.y)/ 16); - if (x < 0) x = 0; - if (x > 15) x = 15; - if (y < 0) y = 0; - if (y > 15) y = 15; - wind.x = module.WindSpeeds[y * 16 + x].X; - wind.y = module.WindSpeeds[y * 16 + x].Y; + int x = (int)(pos.X + offset.x); + int y = (int)(pos.Y + offset.y); + + Vector3 windSpeed = module.WindSpeed(x, y, 0); + + wind.x = windSpeed.X; + wind.y = windSpeed.Y; } return wind; } -- cgit v1.1