aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-30 05:25:50 +0000
committerTeravus Ovares2008-05-30 05:25:50 +0000
commitd2aa2be7889f22c5830dad19e44b5b3234d448a0 (patch)
tree37c4e243426cb75d97de920baaeb5c096a3fb7fb /OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
parent* Updated sun module to only send sun updates to root agents. Because it wa... (diff)
downloadopensim-SC_OLD-d2aa2be7889f22c5830dad19e44b5b3234d448a0.zip
opensim-SC_OLD-d2aa2be7889f22c5830dad19e44b5b3234d448a0.tar.gz
opensim-SC_OLD-d2aa2be7889f22c5830dad19e44b5b3234d448a0.tar.bz2
opensim-SC_OLD-d2aa2be7889f22c5830dad19e44b5b3234d448a0.tar.xz
* Added helper method to the Sun module to Get the Linden hour based on the math in the sun module. This populates the sun phase slider on the terrain tab in the estate tools according to the current sun phase. Display purposes only for now. Need to go the other way for setting the sun phase based on the linden hour in the estate tools.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
index 6e8c28a..889be97 100644
--- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
@@ -94,6 +94,9 @@ namespace OpenSim.Region.Environment.Modules
94 private LLVector3 Position = new LLVector3(0,0,0); 94 private LLVector3 Position = new LLVector3(0,0,0);
95 private LLVector3 Velocity = new LLVector3(0,0,0); 95 private LLVector3 Velocity = new LLVector3(0,0,0);
96 private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); 96 private LLQuaternion Tilt = new LLQuaternion(1,0,0,0);
97 private float LindenEstateHour = 6f;
98 private bool sunFixed = false;
99 private long estateTicksOffset = 0;
97 100
98 private Dictionary<LLUUID, ulong> m_rootAgents = new Dictionary<LLUUID, ulong>(); 101 private Dictionary<LLUUID, ulong> m_rootAgents = new Dictionary<LLUUID, ulong>();
99 102
@@ -101,9 +104,21 @@ namespace OpenSim.Region.Environment.Modules
101 private ulong CurrentTime 104 private ulong CurrentTime
102 { 105 {
103 get { 106 get {
107
104 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000); 108 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000);
105 } 109 }
106 } 110 }
111 private float GetLindenEstateHourFromCurrentTime()
112 {
113 float ticksleftover = ((float)((ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset) / 10000000))) % ((float)SecondsPerSunCycle);
114 //m_log.Debug("[TICKS]: " + ticksleftover.ToString());
115 float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6;
116 //m_log.Debug("[LINDENHOUR]: " + hour.ToString());
117 //m_log.Debug("[SunCycle]: " + (ticksleftover / 3600));
118 //m_log.Debug("[DayLength]: " + m_day_length.ToString());
119
120 return hour;
121 }
107 122
108 // Called immediately after the module is loaded for a given region 123 // Called immediately after the module is loaded for a given region
109 // i.e. Immediately after instance creation. 124 // i.e. Immediately after instance creation.
@@ -256,6 +271,7 @@ namespace OpenSim.Region.Environment.Modules
256 271
257 // set estate settings for region access to sun position 272 // set estate settings for region access to sun position
258 m_scene.RegionInfo.EstateSettings.sunPosition = Position; 273 m_scene.RegionInfo.EstateSettings.sunPosition = Position;
274 m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime();
259 } 275 }
260 276
261 /// <summary> 277 /// <summary>