From 1342e89a8f60b115c8da3b79ddd5846931c9fefa Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 28 Oct 2008 02:34:03 +0000 Subject: Update Sun options in OpenSim.ini.example. Minor cleanup in SunModule.cs. --- OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') 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 private Dictionary m_rootAgents = new Dictionary(); - // Current time in elpased seconds since Jan 1st 1970 + // Current time in elapsed seconds since Jan 1st 1970 private ulong CurrentTime { get { @@ -145,14 +145,12 @@ namespace OpenSim.Region.Environment.Modules LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); - } + // Called immediately after the module is loaded for a given region // i.e. Immediately after instance creation. - public void Initialise(Scene scene, IConfigSource config) { - m_log.Debug("[SUN] Initializing"); m_scene = scene; @@ -176,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules // m_latitude = config.Configs["Sun"].GetDouble("latitude", d_latitude); // Mode: determines how the sun is handled // m_longitude = config.Configs["Sun"].GetDouble("longitude", d_longitude); - // Day length in decimal hours + // Year length in days m_year_length = config.Configs["Sun"].GetInt("year_length", d_year_length); // Day length in decimal hours m_day_length = config.Configs["Sun"].GetDouble("day_length", d_day_length); @@ -304,6 +302,7 @@ namespace OpenSim.Region.Environment.Modules m_scene.RegionInfo.RegionSettings.SunVector = Position; //m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime(); } + public void ForceSunUpdateToAllClients() { GenSunPos(); // Generate shared values once @@ -319,13 +318,12 @@ namespace OpenSim.Region.Environment.Modules m_scene.RegionInfo.RegionSettings.SunVector = Position; m_scene.RegionInfo.RegionSettings.SunPosition = GetLindenEstateHourFromCurrentTime(); } + /// /// Calculate the sun's orbital position and its velocity. /// - private void GenSunPos() { - TotalDistanceTravelled = SunSpeed * CurrentTime; // distance measured in radians OrbitalPosition = (float) (TotalDistanceTravelled%SunCycle); // position measured in radians @@ -435,8 +433,6 @@ namespace OpenSim.Region.Environment.Modules sunFixed = FixedTime; if (sunFixed) GenSunPos(); - - } } } -- cgit v1.1