예제 #1
0
 /// <summary>
 /// Generates a detour around the provided obstacle.
 /// </summary>
 /// <param name="obstacle">The obstacle.</param>
 /// <param name="hitInfo">The hit information.</param>
 /// <param name="fleetRadius">The fleet radius.</param>
 /// <returns></returns>
 private AutoPilotDestinationProxy GenerateDetourAroundObstacle(IAvoidableObstacle obstacle, RaycastHit hitInfo, float fleetRadius) {
     Vector3 detourPosition = obstacle.GetDetour(Position, hitInfo, fleetRadius);
     StationaryLocation detour = new StationaryLocation(detourPosition);
     Vector3 detourOffset = CalcDetourOffset(detour);
     float tgtStandoffDistance = _ship.CollisionDetectionZoneRadius;
     return detour.GetApMoveTgtProxy(detourOffset, tgtStandoffDistance, Position);
 }
예제 #2
0
 /// <summary>
 /// Generates a detour around the provided obstacle.
 /// </summary>
 /// <param name="obstacle">The obstacle.</param>
 /// <param name="hitInfo">The hit information.</param>
 /// <param name="fleetRadius">The fleet radius.</param>
 /// <returns></returns>
 protected INavigable GenerateDetourAroundObstacle(IAvoidableObstacle obstacle, RaycastHit hitInfo, float fleetRadius) {
     Vector3 detourPosition = obstacle.GetDetour(Position, hitInfo, fleetRadius);
     return new StationaryLocation(detourPosition);
 }