mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Thank you kindly, MCortez for a patch that:
With some support from HomerH, this patch adds support for Wind Model plugins via the mono.Addin framework. * Adds console & OSSL access to Wind Parameters * Adds plug-in support for custom wind models * Provides two example Wind Model plug-ins Documentation for the wind module is temporarily located at http://code.google.com/p/flotsam/wiki/CoreWindModule [^] -- will move this documentation to http://opensimulator.org [^] after the patch has been committed.
This commit is contained in:
@@ -268,7 +268,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
//
|
||||
// OpenSim functions
|
||||
//
|
||||
|
||||
public int osTerrainSetHeight(int x, int y, double val)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
|
||||
@@ -920,6 +919,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
|
||||
|
||||
public string osWindActiveModelPluginName()
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
IWindModule module = World.RequestModuleInterface<IWindModule>();
|
||||
if (module != null)
|
||||
{
|
||||
return module.WindActiveModelPluginName;
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void osWindParamSet(string plugin, string param, float value)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
IWindModule module = World.RequestModuleInterface<IWindModule>();
|
||||
if (module != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
module.WindParamSet(plugin, param, value);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
public float osWindParamGet(string plugin, string param)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
IWindModule module = World.RequestModuleInterface<IWindModule>();
|
||||
if (module != null)
|
||||
{
|
||||
return module.WindParamGet(plugin, param);
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public double osList2Double(LSL_Types.list src, int index)
|
||||
|
||||
@@ -104,6 +104,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
double osSunGetParam(string param);
|
||||
void osSunSetParam(string param, double value);
|
||||
|
||||
// Wind Module Functions
|
||||
string osWindActiveModelPluginName();
|
||||
void osWindParamSet(string plugin, string param, float value);
|
||||
float osWindParamGet(string plugin, string param);
|
||||
|
||||
|
||||
string osGetScriptEngineName();
|
||||
string osGetSimulatorVersion();
|
||||
|
||||
@@ -87,6 +87,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_OSSL_Functions.osSunSetParam(param, value);
|
||||
}
|
||||
|
||||
public string osWindActiveModelPluginName()
|
||||
{
|
||||
return m_OSSL_Functions.osWindActiveModelPluginName();
|
||||
}
|
||||
|
||||
void osWindParamSet(string plugin, string param, float value)
|
||||
{
|
||||
m_OSSL_Functions.osWindParamSet(plugin, param, value);
|
||||
}
|
||||
|
||||
float osWindParamGet(string plugin, string param)
|
||||
{
|
||||
return m_OSSL_Functions.osWindParamGet(plugin, param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public double osList2Double(LSL_Types.list src, int index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user