diff options
author | Teravus Ovares | 2008-09-26 12:56:17 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-26 12:56:17 +0000 |
commit | 6b13730bc7451a407c6370d289545542c66a74ea (patch) | |
tree | 82a649a73dd2aca6bbe5dd783b3ec98ca275b6ea /OpenSim/Region/Environment/Modules/World/Wind/WindModule.cs | |
parent | Remove interfaces that are no longer used from DNE (diff) | |
download | opensim-SC_OLD-6b13730bc7451a407c6370d289545542c66a74ea.zip opensim-SC_OLD-6b13730bc7451a407c6370d289545542c66a74ea.tar.gz opensim-SC_OLD-6b13730bc7451a407c6370d289545542c66a74ea.tar.bz2 opensim-SC_OLD-6b13730bc7451a407c6370d289545542c66a74ea.tar.xz |
* Wind updates. Still random.. but in 4 directions instead of two!
* It seems kind of silly to be building a 256x256 array just to use two 16 float blocks.. but for now the layerdata routine requires it so we'll go along with that.
* We only fill a 32x16 area of the 256x256 float array with data.
* We use patches 0,0 and 0,1 for the first and second patch to determine the direction and magnitude of the wind.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Wind/WindModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Wind/WindModule.cs | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Wind/WindModule.cs b/OpenSim/Region/Environment/Modules/World/Wind/WindModule.cs index 190cc0b..d7bc42f 100644 --- a/OpenSim/Region/Environment/Modules/World/Wind/WindModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Wind/WindModule.cs | |||
@@ -149,28 +149,11 @@ namespace OpenSim.Region.Environment.Modules | |||
149 | { | 149 | { |
150 | if (!avatar.IsChildAgent) | 150 | if (!avatar.IsChildAgent) |
151 | { | 151 | { |
152 | spotxp = (int)avatar.CameraPosition.X + 3; | 152 | |
153 | spotxm = (int)avatar.CameraPosition.X - 3; | 153 | avatar.ControllingClient.SendWindData( |
154 | spotyp = (int)avatar.CameraPosition.Y + 3; | 154 | 0, |
155 | spotym = (int)avatar.CameraPosition.Y - 3; | 155 | 0,0,1, |
156 | if (spotxm < 0) | 156 | windarr); |
157 | spotxm = 0; | ||
158 | if (spotym < 0) | ||
159 | spotym = 0; | ||
160 | if (spotxp > 255) | ||
161 | spotxp = 255; | ||
162 | if (spotyp > 255) | ||
163 | spotyp = 255; | ||
164 | for (int x = spotxm; x<spotxp; x++) | ||
165 | { | ||
166 | for (int y = spotym; y<spotyp; y++) | ||
167 | { | ||
168 | avatar.ControllingClient.SendWindData( | ||
169 | x / Constants.TerrainPatchSize, | ||
170 | y / Constants.TerrainPatchSize, | ||
171 | windarr); | ||
172 | } | ||
173 | } | ||
174 | } | 157 | } |
175 | } | 158 | } |
176 | 159 | ||
@@ -199,14 +182,33 @@ namespace OpenSim.Region.Environment.Modules | |||
199 | 182 | ||
200 | private void GenWindPos() | 183 | private void GenWindPos() |
201 | { | 184 | { |
202 | windarr = new float[256*256]; | 185 | //windarr = new float[256*256]; |
203 | for (int x = 0; x < 256; x++) | 186 | |
187 | Array.Clear(windarr, 0, 256 * 256); | ||
188 | //float i = 0f; | ||
189 | //float i2 = 2f; | ||
190 | |||
191 | for (int x = 0; x < 16; x++) | ||
204 | { | 192 | { |
205 | for (int y = 0; y < 256; y++) | 193 | for (int y = 0; y < 16; y++) |
206 | { | 194 | { |
207 | windarr[y*256 + x]= (float)(rndnums.NextDouble()* 2d - 1d); | 195 | |
196 | windarr[x * 256 + y] = (float)(rndnums.NextDouble() * 2d - 1d); | ||
197 | |||
208 | } | 198 | } |
199 | |||
209 | } | 200 | } |
201 | for (int x = 16; x < 32; x++) | ||
202 | { | ||
203 | for (int y = 0; y < 16; y++) | ||
204 | { | ||
205 | |||
206 | windarr[x * 256 + y] = (float)(rndnums.NextDouble() * 2d - 1d); | ||
207 | |||
208 | } | ||
209 | |||
210 | } | ||
211 | |||
210 | 212 | ||
211 | // m_log.Debug("[SUN] Velocity("+Velocity.X+","+Velocity.Y+","+Velocity.Z+")"); | 213 | // m_log.Debug("[SUN] Velocity("+Velocity.X+","+Velocity.Y+","+Velocity.Z+")"); |
212 | } | 214 | } |