/// <summary>
 ///  
 /// </summary>
 /// <param name="finalTarget"></param>
 /// <param name="maxDistance"></param>
 /// <param name="maxSeconds"></param>
 /// <returns></returns>
 public override bool SimpleMoveTo(Vector3d finalTarget, double maxDistance, float maxSeconds, bool stopAtEnd)
 {
     if (false)
     {
         Random MyRand = new Random();
         if (MyRand.Next(5) < 2)
             Client.Self.LookAtEffect(ID, UUID.Zero, finalTarget, (LookAtType)MyRand.Next(11), ID);
     }
     OnlyMoveOnThisThread();
     ///TurnToward(finalTarget);
     IsBlocked = false;
     double currentDist = DistanceNoZ(finalTarget, GlobalPosition);
     if (currentDist < maxDistance) return true;
     bool adjustCourse = false;
     switch (SimpleMoveToMovementProceedure)
     {
         case MovementProceedure.Teleport:
             bool tp = this.TeleportTo(SimRegion.GetWaypoint(finalTarget));
             adjustCourse = false;
             if (!tp)
             {
                 Debug("TP failed => MoveToMovementProceedure = MovementProceedure.TurnToAndWalk;");
                 SimpleMoveToMovementProceedure = MovementProceedure.TurnToAndWalk;
                 adjustCourse = true;
             }
             break;
         case MovementProceedure.AStar:
             Debug(" BAD SimpleMoveToMovementProceedure=" + SimpleMoveToMovementProceedure);
             SimpleMoveToMovementProceedure = MovementProceedure.TurnToAndWalk;
             return GotoTargetAStar(SimRegion.GetWaypoint(finalTarget));
         case MovementProceedure.FlyTo:
         case MovementProceedure.AutoPilot:
         case MovementProceedure.TurnToAndWalk:
         case MovementProceedure.CogPusher:
         default:
             adjustCourse = true;
             break;
     }
     if (adjustCourse)
     {
         lock (TrackerLoopLock)
         {
             ApproachVector3D = finalTarget;
             ApproachDistance = maxDistance;
         }
     }
     return WaitUntilPosSimple(finalTarget, maxDistance, maxSeconds, false);
 }
Beispiel #2
0
 private static TrialProc UseTimes(MovementProceedure proc, int numTimes)
 {
     return(new TrialProc {
         Proc = proc, Times = numTimes
     });
 }
Beispiel #3
0
 private static TrialProc UseTimes(MovementProceedure proc, int numTimes)
 {
     return new TrialProc { Proc = proc, Times = numTimes };
 }