Пример #1
0
        public static void DrawPath(CelestialBody body, WayPoint wp0, WayPoint wp1, Color c, float alpha = -1)
        {
            if (alpha >= 0)
            {
                c.a = alpha;
            }
            if (c.a.Equals(0))
            {
                return;
            }
            var      D          = wp1.AngleTo(wp0);
            var      N          = (int)Mathf.Clamp((float)D * Mathf.Rad2Deg, 1, 5);
            var      dD         = D / N;
            var      last_point = wp0.WorldPos(body);
            Vector3d point;
            Color    line_color = c;

            line_color.a /= 2;
            for (int i = 1; i < N; i++)
            {
                var p = wp0.PointBetween(wp1, dD * i);
                p.SetAlt2Surface(body);
                Markers.DrawCBMarker(body, p, c, out point, PathNodeMarker, path_point_size);
                Utils.GLLine(last_point, point, line_color);
                last_point = point;
            }
            Utils.GLLine(last_point, wp1.WorldPos(body), line_color);
        }
        static void DrawPath(CelestialBody body, WayPoint wp0, WayPoint wp1, Color c)
        {
            var D  = wp1.AngleTo(wp0);
            var N  = (int)Mathf.Clamp((float)D * Mathf.Rad2Deg, 2, 5);
            var dD = D / N;

            for (int i = 1; i < N; i++)
            {
                var p = wp0.PointBetween(wp1, dD * i);
                DrawGroundMarker(body, p, c, IconSize / 2, PathNodeMarker);
            }
        }