Example #1
0
        public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            _scene = scene;

            // Default to ground turbulence
            for (int y = 0; y < 16; y++)
            {
                for (int x = 0; x < 16; x++)
                {
                    m_options[y * 16 + x] = WindConstants.WindSpeedTurbulence;
                }
            }

            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgWindStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgWindStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgWindDirection  = windConfig.GetFloat("avg_direction", 0.0F);
                m_varWindStrength   = windConfig.GetFloat("var_strength", 5.0F);
                m_varWindDirection  = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChangeAloft   = windConfig.GetFloat("rate_change_aloft", 1.0f);
                m_rateChangeFlutter = windConfig.GetFloat("rate_change_flutter", 64.0f);

                LogSettings();
            }
        }
Example #2
0
 public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
 {
     if (windConfig != null)
     {
         if (windConfig.Contains("strength"))
         {
             m_strength = windConfig.GetFloat("strength", 1.0F);
         }
     }
 }
 public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
 {
     if (windConfig != null)
     {
         if (windConfig.Contains("strength"))
         {
             m_strength = windConfig.GetFloat("strength", 1.0f);
         }
         if (windConfig.Contains("damping"))
         {
             m_damping_rate = windConfig.GetFloat("damping", 0);
             if (m_damping_rate > 1.0f)
             {
                 m_damping_rate = 1.0f;
             }
         }
         if (windConfig.Contains("force"))
         {
             m_init_force = windConfig.GetInt("force", 0);
             if (m_init_force < 0 || m_init_force > 2)
             {
                 m_init_force = 0;
             }
         }
         //
         if (windConfig.Contains("region"))
         {
             m_region_size = windConfig.GetInt("region", 256);
             m_region_size = (((int)Math.Abs(m_region_size) + 255) / 256) * 256;
             if (m_region_size == 0)
             {
                 m_region_size = 256;
             }
         }
         if (scene != null)
         {
             m_region_size = (int)scene.RegionInfo.RegionSizeX;
         }
     }
 }
        public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgDirection = windConfig.GetFloat("avg_direction", 0.0F);
                m_varStrength  = windConfig.GetFloat("var_strength", 5.0F);
                m_varDirection = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChange   = windConfig.GetFloat("rate_change", 1.0F);

                LogSettings();
            }
        }
 public float GetFloat(string key, float defaultValue)
 {
     return(config.GetFloat(key, defaultValue));
 }