OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osGetCurrentSunHour C# (CSharp) Method

osGetCurrentSunHour() public method

Return the current Sun Hour 0...24, with 0 being roughly sun-rise
public osGetCurrentSunHour ( ) : double
return double
        public double osGetCurrentSunHour()
        {
            CheckThreatLevel(ThreatLevel.None, "osGetCurrentSunHour");

            m_host.AddScriptLPS(1);

            // Must adjust for the fact that Region Sun Settings are still LL offset
            double sunHour = World.RegionInfo.RegionSettings.SunPosition - 6;

            // See if the sun module has registered itself, if so it's authoritative
            ISunModule module = World.RequestModuleInterface<ISunModule>();
            if (module != null)
            {
                sunHour = module.GetCurrentSunHour();
            }

            return sunHour;
        }
OSSL_Api