My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
CoreWindModule  
Instructions on how to use the Core Wind Module in OpenSim
Updated Feb 4, 2010 by mcor...@gmail.com

Introduction

The 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 settings

The 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 Commands

The "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 Support

Each 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 Support

LSL Functions

The 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 Functions

The OSSL functions must be enabled and permission provided by a region administrator.

  • osWindActiveModelPluginName() -- Returns the name of the current wind model. You can use this to determine if a script wants to use llWind() or an alternative.
  • osWindParamSet(string plugin, string param, float value) - Allows you to set wind parameters. Can be used for configuring wind in-world during events such as sailing regattas.
  • float osWindParamGet(string plugin, string param) - Allows you to retrieve the current wind parameters.

Wind Model Plug-ins

SimpleRandomWind

The SimpleRandomWind Wind Model plugin, simply breaks the region up into a 16x16 grid, and creates a random wind in each grid cell.

Configuration Parameters

  • strength - Sets the strength of the random wind.

ConfigurableWind

The 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

  • avgStrength - average/predominate wind strength
  • avgDirection - average/predominate wind direction in degrees
  • varStrength - allowable variance in wind strength
  • varDirection - allowable variance in wind direction in +/- degrees
  • rateChange - rate of change

Creating custom Wind Model Plug-ins

Creating 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>

Sign in to add a comment
Powered by Google Project Hosting