Inheritance: Message
Example #1
0
 public static Pos3D FromString(string value)
 {
     try
     {
         var s = value.Split('|');
         var result = new Pos3D();
         result.Camera = new Point3D(Convert.ToDouble(s[0], CultureInfo.InvariantCulture), Convert.ToDouble(s[1], CultureInfo.InvariantCulture),  Convert.ToDouble(s[2], CultureInfo.InvariantCulture));
         result.Destination = new Point3D(Convert.ToDouble(s[3], CultureInfo.InvariantCulture), Convert.ToDouble(s[4], CultureInfo.InvariantCulture), Convert.ToDouble(s[5], CultureInfo.InvariantCulture));
         return result;
     }
     catch (Exception e)
     {
         Console.WriteLine("Error parsing command:" + e.Message);
         return null;
     }
 }
Example #2
0
        public void Send3DMessage()
        {
            var wm = new WebMercator();
            var p = new Pos3D();
            var mpC = (MapPoint)wm.ToGeographic(finishPoint.Mp);
            var mpD = (MapPoint)wm.ToGeographic(startPoint.Mp);
            if (AutoHeight)
            {
                var d = SphericalMercator.Distance(mpC.Y, mpC.X, mpD.Y, mpD.X, 'K') * 100; // distance in km times 10.

                finishPoint.Altitude = 2 + d * d * 0.15;
                //finishPoint.Altitude = Math.Max(res*res*100, 0);
                startPoint.Altitude = 0;
            }

            p.Camera = new Point3D(mpC.X, mpC.Y, finishPoint.Altitude);
            p.Destination = new Point3D(mpD.X, mpD.Y, startPoint.Altitude);
            _lastMes = p.ToString();
        }