diff options
author | Charles Krinke | 2009-03-31 02:33:19 +0000 |
---|---|---|
committer | Charles Krinke | 2009-03-31 02:33:19 +0000 |
commit | 54a27f9f5c556e518c2ba18b9a5494d517dfd041 (patch) | |
tree | 5da9db44878c217e0c1872da0f963d88575ef8ff /OpenSim/Region/ScriptEngine/Shared | |
parent | Update svn properties, add copyright header, formatting cleanup. (diff) | |
download | opensim-SC_OLD-54a27f9f5c556e518c2ba18b9a5494d517dfd041.zip opensim-SC_OLD-54a27f9f5c556e518c2ba18b9a5494d517dfd041.tar.gz opensim-SC_OLD-54a27f9f5c556e518c2ba18b9a5494d517dfd041.tar.bz2 opensim-SC_OLD-54a27f9f5c556e518c2ba18b9a5494d517dfd041.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
3 files changed, 65 insertions, 1 deletions
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 | |||
268 | // | 268 | // |
269 | // OpenSim functions | 269 | // OpenSim functions |
270 | // | 270 | // |
271 | |||
272 | public int osTerrainSetHeight(int x, int y, double val) | 271 | public int osTerrainSetHeight(int x, int y, double val) |
273 | { | 272 | { |
274 | CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); | 273 | CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); |
@@ -920,6 +919,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
920 | } | 919 | } |
921 | 920 | ||
922 | 921 | ||
922 | public string osWindActiveModelPluginName() | ||
923 | { | ||
924 | CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName"); | ||
925 | m_host.AddScriptLPS(1); | ||
926 | |||
927 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | ||
928 | if (module != null) | ||
929 | { | ||
930 | return module.WindActiveModelPluginName; | ||
931 | } | ||
932 | |||
933 | return String.Empty; | ||
934 | } | ||
935 | |||
936 | public void osWindParamSet(string plugin, string param, float value) | ||
937 | { | ||
938 | CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet"); | ||
939 | m_host.AddScriptLPS(1); | ||
940 | |||
941 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | ||
942 | if (module != null) | ||
943 | { | ||
944 | try | ||
945 | { | ||
946 | module.WindParamSet(plugin, param, value); | ||
947 | } | ||
948 | catch (Exception) { } | ||
949 | } | ||
950 | } | ||
951 | |||
952 | public float osWindParamGet(string plugin, string param) | ||
953 | { | ||
954 | CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet"); | ||
955 | m_host.AddScriptLPS(1); | ||
956 | |||
957 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | ||
958 | if (module != null) | ||
959 | { | ||
960 | return module.WindParamGet(plugin, param); | ||
961 | } | ||
962 | |||
963 | return 0.0f; | ||
964 | } | ||
965 | |||
923 | 966 | ||
924 | 967 | ||
925 | public double osList2Double(LSL_Types.list src, int index) | 968 | 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 | |||
104 | double osSunGetParam(string param); | 104 | double osSunGetParam(string param); |
105 | void osSunSetParam(string param, double value); | 105 | void osSunSetParam(string param, double value); |
106 | 106 | ||
107 | // Wind Module Functions | ||
108 | string osWindActiveModelPluginName(); | ||
109 | void osWindParamSet(string plugin, string param, float value); | ||
110 | float osWindParamGet(string plugin, string param); | ||
111 | |||
107 | 112 | ||
108 | string osGetScriptEngineName(); | 113 | string osGetScriptEngineName(); |
109 | string osGetSimulatorVersion(); | 114 | 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 | |||
87 | m_OSSL_Functions.osSunSetParam(param, value); | 87 | m_OSSL_Functions.osSunSetParam(param, value); |
88 | } | 88 | } |
89 | 89 | ||
90 | public string osWindActiveModelPluginName() | ||
91 | { | ||
92 | return m_OSSL_Functions.osWindActiveModelPluginName(); | ||
93 | } | ||
94 | |||
95 | void osWindParamSet(string plugin, string param, float value) | ||
96 | { | ||
97 | m_OSSL_Functions.osWindParamSet(plugin, param, value); | ||
98 | } | ||
99 | |||
100 | float osWindParamGet(string plugin, string param) | ||
101 | { | ||
102 | return m_OSSL_Functions.osWindParamGet(plugin, param); | ||
103 | } | ||
104 | |||
105 | |||
90 | 106 | ||
91 | public double osList2Double(LSL_Types.list src, int index) | 107 | public double osList2Double(LSL_Types.list src, int index) |
92 | { | 108 | { |