Fixed several problems with the Sun: some settings didn't work, or were inconsistently used. - The sun position is always calculated by combining the sun settings in the Region and Estate. This fixes the problem that 'UseEstateSun' didn't work. - To remove ambiguity, the EstateToolsSunUpdate event no longer accepts the sun's position as parameters. That's because the position is always calculated from the Region and Estate settings. - Use only the 'FixedSun' flag to determine whether the sun is fixed; not the 'UseGlobalTime' flag. - Don't change the region's 'SunPosition' field according to the sun's position: this field is used only to set the position when using a FixedSun. (The 'SunVector' field does get updated according to the sun's position in the sky)

This commit is contained in:
Oren Hurvitz
2012-12-25 10:47:45 +02:00
committed by Justin Clark-Casey (justincc)
parent 24e486e9df
commit 1a6694b264
5 changed files with 37 additions and 61 deletions

View File

@@ -1205,12 +1205,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
sunHour += 24.0;
World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun;
World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30
World.RegionInfo.RegionSettings.FixedSun = sunFixed;
World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30
World.RegionInfo.RegionSettings.FixedSun = sunFixed;
World.RegionInfo.RegionSettings.Save();
World.EventManager.TriggerEstateToolsSunUpdate(
World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour);
World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle);
}
/// <summary>
@@ -1235,8 +1234,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
World.RegionInfo.EstateSettings.FixedSun = sunFixed;
World.RegionInfo.EstateSettings.Save();
World.EventManager.TriggerEstateToolsSunUpdate(
World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour);
World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle);
}
/// <summary>