diff options
author | UbitUmarov | 2016-09-23 12:32:40 +0100 |
---|---|---|
committer | UbitUmarov | 2016-09-23 12:32:40 +0100 |
commit | 984cb385831e6613fade75046d352a2f68f3ae2b (patch) | |
tree | 042f22c7d97f456fbdbab84ba81f41f063abe821 /OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs | |
parent | bug fix: add a missing return; add some error messages (diff) | |
download | opensim-SC_OLD-984cb385831e6613fade75046d352a2f68f3ae2b.zip opensim-SC_OLD-984cb385831e6613fade75046d352a2f68f3ae2b.tar.gz opensim-SC_OLD-984cb385831e6613fade75046d352a2f68f3ae2b.tar.bz2 opensim-SC_OLD-984cb385831e6613fade75046d352a2f68f3ae2b.tar.xz |
move wind generation out of heartbeat to a pool job. Use that to send to all clients and not one per client
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs index fcb0c10..d2ff7b3 100644 --- a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs +++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs | |||
@@ -82,22 +82,23 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | public void WindUpdate(uint frame) | 85 | public bool WindUpdate(uint frame) |
86 | { | 86 | { |
87 | //Make sure our object is valid (we haven't been disposed of yet) | 87 | //Make sure our object is valid (we haven't been disposed of yet) |
88 | if (m_windSpeeds != null) | 88 | if (m_windSpeeds == null) |
89 | return false; | ||
90 | |||
91 | for (int y = 0; y < 16; y++) | ||
89 | { | 92 | { |
90 | for (int y = 0; y < 16; y++) | 93 | for (int x = 0; x < 16; x++) |
91 | { | 94 | { |
92 | for (int x = 0; x < 16; x++) | 95 | m_windSpeeds[y * 16 + x].X = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 |
93 | { | 96 | m_windSpeeds[y * 16 + x].Y = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 |
94 | m_windSpeeds[y * 16 + x].X = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 | 97 | m_windSpeeds[y * 16 + x].X *= m_strength; |
95 | m_windSpeeds[y * 16 + x].Y = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 | 98 | m_windSpeeds[y * 16 + x].Y *= m_strength; |
96 | m_windSpeeds[y * 16 + x].X *= m_strength; | ||
97 | m_windSpeeds[y * 16 + x].Y *= m_strength; | ||
98 | } | ||
99 | } | 99 | } |
100 | } | 100 | } |
101 | return true; | ||
101 | } | 102 | } |
102 | 103 | ||
103 | public Vector3 WindSpeed(float fX, float fY, float fZ) | 104 | public Vector3 WindSpeed(float fX, float fY, float fZ) |