aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorJeff Ames2008-10-28 02:34:03 +0000
committerJeff Ames2008-10-28 02:34:03 +0000
commit1342e89a8f60b115c8da3b79ddd5846931c9fefa (patch)
tree4314ee54f60095ef440cb34a7eefce260f684d21 /OpenSim/Region/Environment
parentExperimental patch (suggested by diva) to kill off WP teleport ghosts. (diff)
downloadopensim-SC_OLD-1342e89a8f60b115c8da3b79ddd5846931c9fefa.zip
opensim-SC_OLD-1342e89a8f60b115c8da3b79ddd5846931c9fefa.tar.gz
opensim-SC_OLD-1342e89a8f60b115c8da3b79ddd5846931c9fefa.tar.bz2
opensim-SC_OLD-1342e89a8f60b115c8da3b79ddd5846931c9fefa.tar.xz
Update Sun options in OpenSim.ini.example. Minor cleanup in SunModule.cs.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs14
1 files changed, 5 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
index 826fe93..318afa1 100644
--- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules
100 100
101 private Dictionary<UUID, ulong> m_rootAgents = new Dictionary<UUID, 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 elapsed seconds since Jan 1st 1970
104 private ulong CurrentTime 104 private ulong CurrentTime
105 { 105 {
106 get { 106 get {
@@ -145,14 +145,12 @@ namespace OpenSim.Region.Environment.Modules
145 145
146 LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); 146 LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length));
147 m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); 147 m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString());
148
149 } 148 }
149
150 // Called immediately after the module is loaded for a given region 150 // Called immediately after the module is loaded for a given region
151 // i.e. Immediately after instance creation. 151 // i.e. Immediately after instance creation.
152
153 public void Initialise(Scene scene, IConfigSource config) 152 public void Initialise(Scene scene, IConfigSource config)
154 { 153 {
155
156 m_log.Debug("[SUN] Initializing"); 154 m_log.Debug("[SUN] Initializing");
157 155
158 m_scene = scene; 156 m_scene = scene;
@@ -176,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules
176 // m_latitude = config.Configs["Sun"].GetDouble("latitude", d_latitude); 174 // m_latitude = config.Configs["Sun"].GetDouble("latitude", d_latitude);
177 // Mode: determines how the sun is handled 175 // Mode: determines how the sun is handled
178 // m_longitude = config.Configs["Sun"].GetDouble("longitude", d_longitude); 176 // m_longitude = config.Configs["Sun"].GetDouble("longitude", d_longitude);
179 // Day length in decimal hours 177 // Year length in days
180 m_year_length = config.Configs["Sun"].GetInt("year_length", d_year_length); 178 m_year_length = config.Configs["Sun"].GetInt("year_length", d_year_length);
181 // Day length in decimal hours 179 // Day length in decimal hours
182 m_day_length = config.Configs["Sun"].GetDouble("day_length", d_day_length); 180 m_day_length = config.Configs["Sun"].GetDouble("day_length", d_day_length);
@@ -304,6 +302,7 @@ namespace OpenSim.Region.Environment.Modules
304 m_scene.RegionInfo.RegionSettings.SunVector = Position; 302 m_scene.RegionInfo.RegionSettings.SunVector = Position;
305 //m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime(); 303 //m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime();
306 } 304 }
305
307 public void ForceSunUpdateToAllClients() 306 public void ForceSunUpdateToAllClients()
308 { 307 {
309 GenSunPos(); // Generate shared values once 308 GenSunPos(); // Generate shared values once
@@ -319,13 +318,12 @@ namespace OpenSim.Region.Environment.Modules
319 m_scene.RegionInfo.RegionSettings.SunVector = Position; 318 m_scene.RegionInfo.RegionSettings.SunVector = Position;
320 m_scene.RegionInfo.RegionSettings.SunPosition = GetLindenEstateHourFromCurrentTime(); 319 m_scene.RegionInfo.RegionSettings.SunPosition = GetLindenEstateHourFromCurrentTime();
321 } 320 }
321
322 /// <summary> 322 /// <summary>
323 /// Calculate the sun's orbital position and its velocity. 323 /// Calculate the sun's orbital position and its velocity.
324 /// </summary> 324 /// </summary>
325
326 private void GenSunPos() 325 private void GenSunPos()
327 { 326 {
328
329 TotalDistanceTravelled = SunSpeed * CurrentTime; // distance measured in radians 327 TotalDistanceTravelled = SunSpeed * CurrentTime; // distance measured in radians
330 OrbitalPosition = (float) (TotalDistanceTravelled%SunCycle); // position measured in radians 328 OrbitalPosition = (float) (TotalDistanceTravelled%SunCycle); // position measured in radians
331 329
@@ -435,8 +433,6 @@ namespace OpenSim.Region.Environment.Modules
435 sunFixed = FixedTime; 433 sunFixed = FixedTime;
436 if (sunFixed) 434 if (sunFixed)
437 GenSunPos(); 435 GenSunPos();
438
439
440 } 436 }
441 } 437 }
442 } 438 }