Exemple #1
0
        public static void SetTimeOfDay(double time)
        {
            MAstroBody   Sol = MPlanetHandler.Get("Sol");
            Quaterniond  q   = Quaterniond.FromEulerAngles(0, 0, time * Math.PI / 180.0);
            MSceneObject mo  = (MSceneObject)MScene.AstroRoot.FindModuleByName("Sol");

            mo.SetPosition(new Vector3d(time * 10000000000, 0, 0));
        }
Exemple #2
0
        public static void SetTimeOfDay(double _time)
        {
            time = _time;
            MAstroBody   Sol = MPlanetHandler.Get("Sol");
            Quaterniond  q   = Quaterniond.FromEulerAngles(0, (15 * time) * Math.PI / 180.0, 0);
            MSceneObject mo  = (MSceneObject)MScene.AstroRoot.FindModuleByName("Sol");

            mo.SetPosition(q * new Vector3d(Sol.DistanceToAvatar, 0, 0));
            MMessageBus.Navigate(null, mo.transform.Position);

            double ottime = (time + timeOffset) % 24;

            float f24 = (float)Math.Sin((ottime * 15.0) * Math.PI / 180.0);

            //f24 = Math.Min((float)Math.Pow(f24, 0.2), 1);
            f24 = Math.Max(f24, 0.02f);
            MScene.light.Ambient = new Vector3(f24, f24, f24);
        }