public void UpdateUI(TrajectoryData.Intercept intercept) { this.intercept = intercept; titleText.text = "Intercept"; summaryText.text = string.Format("dV={0:0.00} time={1:0.00}", intercept.dV, intercept.dT); maneuverText.text = string.Format("time={0:0.0} dV={1:0.0}\n", intercept.tp1.t, intercept.dV); }
/// <summary> /// Add the manuever specified by the intercept to add a course correction /// at the intercept time to have the spaceship match the target course. /// /// Maneuvers are passed on to the GravityEngine to be executed on the correct /// integrator timeslice. The SpaceshipRV maintains a copy so they can be displayed/tracked. /// </summary> /// <param name="intercept">Intercept.</param> public void SetManeuver(TrajectoryData.Intercept intercept) { Maneuver m = new Maneuver(nbody, intercept); m.onExecuted = ManeuverExecutedCallback; GravityEngine.Instance().AddManeuver(m); maneuverList.Add(m); }
/// <summary> /// Create a vector maneuver at the intercept point to match trajectory /// that was intercepted. /// </summary> /// <param name="nbody"></param> /// <param name="intercept"></param> public Maneuver(NBody nbody, TrajectoryData.Intercept intercept) { this.nbody = nbody; worldTime = intercept.tp1.t; velChange = intercept.tp2.v - intercept.tp1.v; r = intercept.tp1.r; dV = intercept.dV; }
public void InterceptSelected(TrajectoryData.Intercept intercept) { foreach (GameObject uiWidget in orbitUIWidgets) { Destroy(uiWidget); } orbitUIWidgets.Clear(); spaceshipCtrl.SetManeuver(intercept); spaceshipCtrl.ShowManueverAxes(false); SetState(State.MANEUVER); }
public GameObject GetInterceptWidget(TrajectoryData.Intercept intercept, OrbitMGController controller) { GameObject newWidget = Instantiate(interceptPrefab) as GameObject; if (newWidget != null) { OrbitXferUI orbitXferUI = newWidget.GetComponent <OrbitXferUI>(); if (orbitXferUI != null) { orbitXferUI.SetController(controller); orbitXferUI.UpdateUI(intercept); } else { Debug.LogError("No OrbitXferUI component on " + newWidget.name); } } return(newWidget); }