mirror of
https://github.com/opensim/opensim.git
synced 2026-07-20 22:55:38 +08:00
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
This commit is contained in:
@@ -953,7 +953,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public LSL_Vector llWind(LSL_Vector offset)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
return new LSL_Vector();
|
||||
LSL_Vector wind = new LSL_Vector(0, 0, 0);
|
||||
IWindModule module = World.RequestModuleInterface<IWindModule>();
|
||||
if (module != null && module.WindSpeeds != 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;
|
||||
}
|
||||
return wind;
|
||||
}
|
||||
|
||||
public void llSetStatus(int status, int value)
|
||||
|
||||
Reference in New Issue
Block a user