Example #1
0
        /// <summary>
        ///  让采集车移动到有经纬度确定的地点
        ///  Ask the harvester to move to a given location, which is represented
        ///  by longtitude and latitude
        /// </summary>
        /// <param name="lng"></param>
        /// <param name="lat"></param>
        public void Move(float lng, float lat)
        {
            //IsAuto = false;
            movePurpose = MovePurpose.None;

            int sx, sy;

            Map.GetMapCoord(longtitude, latitude, out sx, out sy);

            int tx, ty;

            Map.GetMapCoord(lng, lat, out tx, out ty);

            destX = tx;
            destY = ty;

            finder.Reset();
            currentPath = finder.FindPath(sx, sy, tx, ty);

            // 新的动作要先调整朝向
            // Adjust direction before going
            isAdjustingDirection = true;

            currentNode        = 0;
            nodeMotionProgress = 0;
        }
Example #2
0
        /// <summary>
        ///  让采集车移动到有经纬度确定的地点
        ///  Ask the harvester to move to a given location, which is represented
        ///  by longtitude and latitude
        /// </summary>
        /// <param name="lng"></param>
        /// <param name="lat"></param>
        public void Move(float lng, float lat)
        {
            //IsAuto = false;
            movePurpose = MovePurpose.None;

            int sx, sy;
            Map.GetMapCoord(longtitude, latitude, out sx, out sy);

            int tx, ty;
            Map.GetMapCoord(lng, lat, out tx, out ty);

            destX = tx;
            destY = ty;

            finder.Reset();
            currentPath = finder.FindPath(sx, sy, tx, ty);
            
            // 新的动作要先调整朝向
            // Adjust direction before going
            isAdjustingDirection = true;

            currentNode = 0;
            nodeMotionProgress = 0;
        }
Example #3
0
 /// <summary>
 ///  调用Move之后设置目的,否则为无目的
 ///  To set the purpose of the movment, this should be called after calling move.
 /// </summary>
 /// <param name="purpose"></param>
 public void SetMovePurpose(MovePurpose purpose)
 {
     this.movePurpose = purpose;
 }
Example #4
0
 /// <summary>
 ///  调用Move之后设置目的,否则为无目的
 ///  To set the purpose of the movment, this should be called after calling move.
 /// </summary>
 /// <param name="purpose"></param>
 public void SetMovePurpose(MovePurpose purpose)
 {
     this.movePurpose = purpose;
 }