aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs19
1 files changed, 9 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs
index 6af4050..a2b44df 100644
--- a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
50 private float m_avgDirection = 0.0f; // Average direction of the wind in degrees 50 private float m_avgDirection = 0.0f; // Average direction of the wind in degrees
51 private float m_varStrength = 5.0f; // Max Strength Variance 51 private float m_varStrength = 5.0f; // Max Strength Variance
52 private float m_varDirection = 30.0f;// Max Direction Variance 52 private float m_varDirection = 30.0f;// Max Direction Variance
53 private float m_rateChange = 1.0f; // 53 private float m_rateChange = 1.0f; //
54 54
55 private Vector2 m_curPredominateWind = new Vector2(); 55 private Vector2 m_curPredominateWind = new Vector2();
56 56
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
70 70
71 public void Initialise() 71 public void Initialise()
72 { 72 {
73 73
74 } 74 }
75 75
76 #endregion 76 #endregion
@@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
103 } 103 }
104 } 104 }
105 105
106 public void WindUpdate(uint frame) 106 public bool WindUpdate(uint frame)
107 { 107 {
108 double avgAng = m_avgDirection * (Math.PI/180.0f); 108 double avgAng = m_avgDirection * (Math.PI/180.0f);
109 double varDir = m_varDirection * (Math.PI/180.0f); 109 double varDir = m_varDirection * (Math.PI/180.0f);
@@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
111 // Prevailing wind algorithm 111 // Prevailing wind algorithm
112 // Inspired by Kanker Greenacre 112 // Inspired by Kanker Greenacre
113 113
114 // TODO: 114 // TODO:
115 // * This should probably be based on in-world time. 115 // * This should probably be based on in-world time.
116 // * should probably move all these local variables to class members and constants 116 // * should probably move all these local variables to class members and constants
117 double time = DateTime.Now.TimeOfDay.Seconds / 86400.0f; 117 double time = DateTime.Now.TimeOfDay.Seconds / 86400.0f;
@@ -125,10 +125,8 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
125 offset = Math.Sin(theta) * Math.Sin(theta*4) + (Math.Sin(theta*13) / 3); 125 offset = Math.Sin(theta) * Math.Sin(theta*4) + (Math.Sin(theta*13) / 3);
126 double windSpeed = m_avgStrength + (m_varStrength * offset); 126 double windSpeed = m_avgStrength + (m_varStrength * offset);
127 127
128 if (windSpeed<0) 128 if (windSpeed < 0)
129 windSpeed=0; 129 windSpeed = -windSpeed;
130
131
132 130
133 m_curPredominateWind.X = (float)Math.Cos(windDir); 131 m_curPredominateWind.X = (float)Math.Cos(windDir);
134 m_curPredominateWind.Y = (float)Math.Sin(windDir); 132 m_curPredominateWind.Y = (float)Math.Sin(windDir);
@@ -144,6 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
144 m_windSpeeds[y * 16 + x] = m_curPredominateWind; 142 m_windSpeeds[y * 16 + x] = m_curPredominateWind;
145 } 143 }
146 } 144 }
145 return true;
147 } 146 }
148 147
149 public Vector3 WindSpeed(float fX, float fY, float fZ) 148 public Vector3 WindSpeed(float fX, float fY, float fZ)
@@ -158,9 +157,9 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
158 157
159 public string Description 158 public string Description
160 { 159 {
161 get 160 get
162 { 161 {
163 return "Provides a predominate wind direction that can change within configured variances for direction and speed."; 162 return "Provides a predominate wind direction that can change within configured variances for direction and speed.";
164 } 163 }
165 } 164 }
166 165