OsGetWindParam
From OpenSimulator
(Difference between revisions)
m (Added note stating which version of OpenSim introduced this function) |
|||
(10 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{osslfunc | |
+ | |threat_level=VeryLow | ||
+ | |permissions=true | ||
+ | |delay=0 | ||
+ | |additional_info=This function was added in 0.7.2-post-fixes and replaces the deprecated osWindParamGet function. | ||
+ | |function_syntax=float osGetWindParam(string plugin, string param) | ||
+ | |ossl_example=Gets all available properties of current active wind plugin module: | ||
+ | <source lang="lsl"> | ||
+ | // osGetWindParam() sample | ||
+ | // Touch this object to see the current wind parameters | ||
− | + | default | |
− | + | { | |
− | *''' | + | touch_start(integer number) |
− | + | { | |
− | + | string activePluginName = osWindActiveModelPluginName(); | |
− | + | ||
− | + | if(activePluginName == "SimpleRandomWind") | |
+ | { | ||
+ | llSay(0, "[SimpleRandomWind]"); | ||
+ | float strength = osGetWindParam("SimpleRandomWind", "strength"); | ||
+ | llSay(0, "wind strength(strength) = " + (string)strength); | ||
+ | } | ||
+ | else if(activePluginName == "ConfigurableWind") | ||
+ | { | ||
+ | llSay(0, "[ConfigurableWind]"); | ||
+ | float avgStrength = osGetWindParam("ConfigurableWind", "avgStrength"); | ||
+ | llSay(0, "average wind strength(avg_strength) = " + (string)avgStrength); | ||
+ | float avgDirection = osGetWindParam("ConfigurableWind", "avgDirection"); | ||
+ | llSay(0, "average wind direction in degrees(avg_direction) = " + (string)avgDirection); | ||
+ | float varStrength = osGetWindParam("ConfigurableWind", "varStrength"); | ||
+ | llSay(0, "allowable variance in wind strength(var_strength) = " + (string)varStrength); | ||
+ | float varDirection = osGetWindParam("ConfigurableWind", "varDirection"); | ||
+ | llSay(0, "allowable variance in wind direction in +/- degrees(var_direction) = " + (string)varDirection); | ||
+ | float rateChange = osGetWindParam("ConfigurableWind", "rateChange"); | ||
+ | llSay(0, "rate of change(rate_change) = " + (string)rateChange); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | |description=*Gets the value of '''param''' property for '''plugin''' module. | ||
+ | | | ||
+ | }} | ||
+ | Available parameters: | ||
+ | {|border="1" cellspacing="0" cellpadding="2" width="100%" | ||
+ | !'''plugin'''||'''param'''||Description||Default||OpenSim.ini setting | ||
+ | |- | ||
+ | |SimpleRandomWind||strength||wind strength||1.0f||strength | ||
+ | |- | ||
+ | |rowspan="5"|ConfigurableWind||avgStrength||average wind strength||5.0f||avg_strength | ||
+ | |- | ||
+ | |avgDirection||average wind direction in degrees||0.0f||avg_direction | ||
+ | |- | ||
+ | |varStrength||allowable variance in wind strength||5.0f||var_strength | ||
+ | |- | ||
+ | |varDirection||allowable variance in wind direction in +/- degrees||30.0f||var_direction | ||
+ | |- | ||
+ | |rateChange||rate of change||1.0f||rate_change | ||
+ | |} |
Latest revision as of 07:46, 15 October 2018
float osGetWindParam(string plugin, string param)
| |
| |
Threat Level | VeryLow |
Permissions | Use of this function is always allowed by default |
Extra Delay | 0 seconds |
Example(s) | |
Gets all available properties of current active wind plugin module:
// osGetWindParam() sample // Touch this object to see the current wind parameters default { touch_start(integer number) { string activePluginName = osWindActiveModelPluginName(); if(activePluginName == "SimpleRandomWind") { llSay(0, "[SimpleRandomWind]"); float strength = osGetWindParam("SimpleRandomWind", "strength"); llSay(0, "wind strength(strength) = " + (string)strength); } else if(activePluginName == "ConfigurableWind") { llSay(0, "[ConfigurableWind]"); float avgStrength = osGetWindParam("ConfigurableWind", "avgStrength"); llSay(0, "average wind strength(avg_strength) = " + (string)avgStrength); float avgDirection = osGetWindParam("ConfigurableWind", "avgDirection"); llSay(0, "average wind direction in degrees(avg_direction) = " + (string)avgDirection); float varStrength = osGetWindParam("ConfigurableWind", "varStrength"); llSay(0, "allowable variance in wind strength(var_strength) = " + (string)varStrength); float varDirection = osGetWindParam("ConfigurableWind", "varDirection"); llSay(0, "allowable variance in wind direction in +/- degrees(var_direction) = " + (string)varDirection); float rateChange = osGetWindParam("ConfigurableWind", "rateChange"); llSay(0, "rate of change(rate_change) = " + (string)rateChange); } } } | |
Notes | |
This function was added in 0.7.2-post-fixes and replaces the deprecated osWindParamGet function. |
Available parameters:
plugin | param | Description | Default | OpenSim.ini setting |
---|---|---|---|---|
SimpleRandomWind | strength | wind strength | 1.0f | strength |
ConfigurableWind | avgStrength | average wind strength | 5.0f | avg_strength |
avgDirection | average wind direction in degrees | 0.0f | avg_direction | |
varStrength | allowable variance in wind strength | 5.0f | var_strength | |
varDirection | allowable variance in wind direction in +/- degrees | 30.0f | var_direction | |
rateChange | rate of change | 1.0f | rate_change |