Exemple #1
0
        public static void GetLatitudeSection(float latitude, out float equatorial, out float seasonal, out float polar)
        {
            float num          = Mathf.Abs(latitude);
            float maxLatitude  = LatitudeSection.Equatorial.GetMaxLatitude();
            float maxLatitude2 = LatitudeSection.Seasonal.GetMaxLatitude();
            float maxLatitude3 = LatitudeSection.Polar.GetMaxLatitude();

            if (num <= maxLatitude)
            {
                equatorial = 1f;
                seasonal   = 0f;
                polar      = 0f;
            }
            else if (num <= maxLatitude2)
            {
                equatorial = Mathf.InverseLerp((float)(maxLatitude + 5.0), maxLatitude, num);
                float a = (float)(1.0 - equatorial);
                polar = Mathf.InverseLerp((float)(maxLatitude2 - 5.0), maxLatitude2, num);
                float b = (float)(1.0 - polar);
                seasonal = Mathf.Min(a, b);
                GenMath.NormalizeToSum1(ref equatorial, ref seasonal, ref polar);
            }
            else if (num <= maxLatitude3)
            {
                equatorial = 0f;
                seasonal   = 0f;
                polar      = 1f;
            }
            else
            {
                equatorial = 0f;
                seasonal   = 0f;
                polar      = 0f;
            }
        }