示例#1
0
        public override void OnPhysicsUpdate()
        {
            if (_dv != _newtonMoveDB.DeltaVForManuver_m.Length())
            {
                CreatePointArray();
            }


            Vector3 pos         = myPosDB.RelativePosition_AU;
            var     ralitivePos = new PointD()
            {
                X = pos.X, Y = pos.Y
            };

            double minDist = PointDFunctions.Length(PointDFunctions.Sub(ralitivePos, _points[_index]));

            for (int i = 0; i < _points.Count(); i++)
            {
                double dist = PointDFunctions.Length(PointDFunctions.Sub(ralitivePos, _points[i]));
                if (dist < minDist)
                {
                    minDist = dist;
                    _index  = i;
                }
            }
        }
示例#2
0
        public override void OnPhysicsUpdate()
        {
            Vector3 pos         = myPosDB.RelativePosition_AU;
            var     ralitivePos = new PointD()
            {
                X = pos.X, Y = pos.Y
            };

            double minDist = PointDFunctions.Length(PointDFunctions.Sub(ralitivePos, _points[_index]));

            for (int i = 0; i < _points.Count(); i++)
            {
                double dist = PointDFunctions.Length(PointDFunctions.Sub(ralitivePos, _points[i]));
                if (dist < minDist)
                {
                    minDist = dist;
                    _index  = i;
                }
            }
        }
示例#3
0
 double CalcDistance(PointD p1, PointD p2)
 {
     return(PointDFunctions.Length(PointDFunctions.Sub(p1, p2)));
 }