diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 9690433..826fe93 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using libsecondlife; | 30 | using OpenMetaverse; |
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Environment.Interfaces; | 33 | using OpenSim.Region.Environment.Interfaces; |
@@ -91,14 +91,14 @@ namespace OpenSim.Region.Environment.Modules | |||
91 | // private double VWTimeRatio; // VW time as a ratio of real time | 91 | // private double VWTimeRatio; // VW time as a ratio of real time |
92 | 92 | ||
93 | // Working values | 93 | // Working values |
94 | private LLVector3 Position = new LLVector3(0,0,0); | 94 | private Vector3 Position = Vector3.Zero; |
95 | private LLVector3 Velocity = new LLVector3(0,0,0); | 95 | private Vector3 Velocity = Vector3.Zero; |
96 | private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); | 96 | private Quaternion Tilt = Quaternion.Identity; |
97 | 97 | ||
98 | private long LindenHourOffset = 0; | 98 | private long LindenHourOffset = 0; |
99 | private bool sunFixed = false; | 99 | private bool sunFixed = false; |
100 | 100 | ||
101 | private Dictionary<LLUUID, ulong> m_rootAgents = new Dictionary<LLUUID, ulong>(); | 101 | private Dictionary<UUID, ulong> m_rootAgents = new Dictionary<UUID, ulong>(); |
102 | 102 | ||
103 | // Current time in elpased seconds since Jan 1st 1970 | 103 | // Current time in elpased seconds since Jan 1st 1970 |
104 | private ulong CurrentTime | 104 | private ulong CurrentTime |
@@ -348,14 +348,14 @@ namespace OpenSim.Region.Environment.Modules | |||
348 | // For interest we rotate it slightly about the X access. | 348 | // For interest we rotate it slightly about the X access. |
349 | // Celestial tilt is a value that ranges .025 | 349 | // Celestial tilt is a value that ranges .025 |
350 | 350 | ||
351 | Position = LLVector3.Rot(Position,Tilt); | 351 | Position *= Tilt; |
352 | 352 | ||
353 | // Finally we shift the axis so that more of the | 353 | // Finally we shift the axis so that more of the |
354 | // circle is above the horizon than below. This | 354 | // circle is above the horizon than below. This |
355 | // makes the nights shorter than the days. | 355 | // makes the nights shorter than the days. |
356 | 356 | ||
357 | Position.Z = Position.Z + (float) HorizonShift; | 357 | Position.Z = Position.Z + (float) HorizonShift; |
358 | Position = LLVector3.Norm(Position); | 358 | Position = Vector3.Normalize(Position); |
359 | 359 | ||
360 | // m_log.Debug("[SUN] Position("+Position.X+","+Position.Y+","+Position.Z+")"); | 360 | // m_log.Debug("[SUN] Position("+Position.X+","+Position.Y+","+Position.Z+")"); |
361 | 361 | ||
@@ -365,7 +365,7 @@ namespace OpenSim.Region.Environment.Modules | |||
365 | 365 | ||
366 | // Correct angular velocity to reflect the seasonal rotation | 366 | // Correct angular velocity to reflect the seasonal rotation |
367 | 367 | ||
368 | Magnitude = LLVector3.Mag(Position); | 368 | Magnitude = Position.Length(); |
369 | if (sunFixed) | 369 | if (sunFixed) |
370 | { | 370 | { |
371 | Velocity.X = 0; | 371 | Velocity.X = 0; |
@@ -374,13 +374,12 @@ namespace OpenSim.Region.Environment.Modules | |||
374 | return; | 374 | return; |
375 | } | 375 | } |
376 | 376 | ||
377 | Velocity = LLVector3.Rot(Velocity, Tilt)*((float)(1.0/Magnitude)); | 377 | Velocity = (Velocity * Tilt) * (1.0f / Magnitude); |
378 | 378 | ||
379 | // m_log.Debug("[SUN] Velocity("+Velocity.X+","+Velocity.Y+","+Velocity.Z+")"); | 379 | // m_log.Debug("[SUN] Velocity("+Velocity.X+","+Velocity.Y+","+Velocity.Z+")"); |
380 | |||
381 | } | 380 | } |
382 | 381 | ||
383 | private void ClientLoggedOut(LLUUID AgentId) | 382 | private void ClientLoggedOut(UUID AgentId) |
384 | { | 383 | { |
385 | lock (m_rootAgents) | 384 | lock (m_rootAgents) |
386 | { | 385 | { |
@@ -392,7 +391,7 @@ namespace OpenSim.Region.Environment.Modules | |||
392 | } | 391 | } |
393 | } | 392 | } |
394 | 393 | ||
395 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, LLUUID regionID) | 394 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) |
396 | { | 395 | { |
397 | lock (m_rootAgents) | 396 | lock (m_rootAgents) |
398 | { | 397 | { |