public TargetInfo(StationaryLocation sl, Vector3 fstOffset, float fullSpeed) { Target = sl; //Destination = sl.Position + fstOffset; _fstOffset = fstOffset; CloseEnoughDistance = fullSpeed; // FIXME this value does not get adjusted when OnFullSpeedChanged() occurs CloseEnoughDistanceSqrd = CloseEnoughDistance * CloseEnoughDistance; }
/// <summary> /// Plots a course to a stationary location and notifies the requester of the /// outcome via the onCoursePlotSuccess or Failure events. /// </summary> /// <param name="location">The stationary location.</param> /// <param name="speed">The speed.</param> /// <param name="isFleetMove">if set to <c>true</c> this navigator will only move when the fleet is ready.</param> private void PlotCourse(StationaryLocation location, Speed speed, bool isFleetMove) { // a formationOffset is required if this is a fleet move Vector3 destinationOffset = isFleetMove ? _data.FormationStation.StationOffset : Vector3.zero; _targetInfo = new TargetInfo(location, destinationOffset, _data.FullSpeed); Speed = speed; _isFleetMove = isFleetMove; InitializeTargetValues(); //PlotCourse(); }