|
CoreWindModule
Instructions on how to use the Core Wind Module in OpenSim
IntroductionThe Wind module provides a wind system for your virtual environment. This system uses Wind Models Plug-ins to determine what the current wind is at any given location within the region, and then exposes this information via LSL and OSSL scripting functions, as well as low resolution wind data packets to LL based viewers. The Wind module and it's plug-ins can be configured from the OpenSim.ini file as well as dynamically reconfigured at run-time via both Console commands and OSSL functions. OpenSim.ini settingsThe Wind module presents a number of base settings in the OpenSim.ini parameter file that affect the module as a whole, as well as providing support for individual Wind Model plug-ins to retrieve plug-in specific settings. The following base settings can be specified in the Wind section of OpenSim.ini enabled - This enables or disables the wind model (true/false) wind_update_rate - How often (in simulator frames) should the wind be recalculated (default of 150 is roughly once every 3 seconds) wind_plugin - Specifies the Wind Model plug-in to use. Defaults to SimpleRandomWind Console CommandsThe "wind" command available from the console allows all wind module parameters to be changed at run-time. Usage: wind <plugin> <parameter> [value] To change global parameters such as wind_update_rate or wind_plugin, simply specify "base" as the plug-in. Examples: wind base wind_plugin ConfigurableWind // change the current active Wind Model to ConfigurableWind wind base wind_plugin SimpleRandomWind // change the current active Wind Model to SimpleRandomWind wind base wind_update_rate 50 // change the update rate to 50 frames, or roughly once a second Client Viewer SupportEach time the wind is updated, the Wind module sends a wind data packet to each connected client consisting of 256 Vector2 values representing a 16x16 grid of wind values to the client. Currently LL based viewers use this data for client side wind effects such as swaying trees and flexi-prims. Scripting SupportLSL FunctionsThe LSL wind function LLWind() is fully supported by the Wind Module, although the underlying Wind Model will vary depending on what plug-ins you have installed and enabled. OSSL FunctionsThe OSSL functions must be enabled and permission provided by a region administrator.
Wind Model Plug-insSimpleRandomWindThe SimpleRandomWind Wind Model plugin, simply breaks the region up into a 16x16 grid, and creates a random wind in each grid cell. Configuration Parameters
ConfigurableWindThe ConfigurableWind functions very similar to Wind Beacons used by SL Sailing regattas and allows you to specify a predominate wind direction and strength, as well as the acceptable amount of variance and rate of change. Configuration Parameters
Creating custom Wind Model Plug-insCreating new custom Wind Model plug-ins requires creating a DLL that contains a class that implements IWindModelPlugin interface, as well as a XML Resource file that specifies the mono.Addin parameters for the plug-in. Simply placing this DLL in the OpenSim/bin directory will allow it to be discovered during start-up. Please see the SimpleRandomWind.cs file for a simple example of implementing the IWindModelPlugin. The following is an example of the mono.Addin XML file that will be required: <Addin id="WindModule.MyCustom.WindModels" version="1.0">
<Runtime>
<Import assembly="OpenSim.Region.CoreModules.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/WindModule">
<WindModel id="MyWindModelName" type="OpenSim.Region.CoreModules.World.Wind.Plugins.MyWindModelPluginClass" />
</Extension>
</Addin>
|