From 54a27f9f5c556e518c2ba18b9a5494d517dfd041 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Tue, 31 Mar 2009 02:33:19 +0000 Subject: 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. --- .../Shared/Api/Implementation/OSSL_Api.cs | 45 +++++++++++++++++++++- .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 5 +++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 16 ++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index c87cc44..491a971 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -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(); + 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(); + 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(); + if (module != null) + { + return module.WindParamGet(plugin, param); + } + + return 0.0f; + } + public double osList2Double(LSL_Types.list src, int index) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index a2a0fea..533ed27 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -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(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index fa45836..54ae32a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -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) { -- cgit v1.1