|
|
|
|
@ -45,14 +45,14 @@ void drawEllipseParameters(ellipse_parameters& ep);
|
|
|
|
|
void drawGravitaationalBody(grav_body& body); |
|
|
|
|
void drawOrbitalElements(orbital_elements& el); |
|
|
|
|
void drawSatelliteWindow(satellite& sat); |
|
|
|
|
void drawSystemWindow(system_2body& sys); |
|
|
|
|
void drawSystemWindow(system_2body& sys, bool& running); |
|
|
|
|
|
|
|
|
|
const static int G_WIDTH = 300; |
|
|
|
|
const static ImVec2 V_SPACER(0, 10); |
|
|
|
|
const int H_FLAGS = ImGuiTreeNodeFlags_DefaultOpen; |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
gooDraw(SDL_Window* window, system_2body& sys) |
|
|
|
|
gooDraw(SDL_Window* window, system_2body& sys, bool& running) |
|
|
|
|
{ |
|
|
|
|
ImGui_ImplOpenGL3_NewFrame(); |
|
|
|
|
ImGui_ImplSDL2_NewFrame(window); |
|
|
|
|
@ -64,7 +64,7 @@ gooDraw(SDL_Window* window, system_2body& sys)
|
|
|
|
|
ImGui::SetNextWindowSize(ImVec2(G_WIDTH, y)); |
|
|
|
|
ImGui::Begin("Gooey"); |
|
|
|
|
|
|
|
|
|
drawSystemWindow(sys); |
|
|
|
|
drawSystemWindow(sys, running); |
|
|
|
|
drawSatelliteWindow(sys.sat); |
|
|
|
|
drawGravitaationalBody(sys.body); |
|
|
|
|
drawOrbitalElements(sys.elements); |
|
|
|
|
@ -124,19 +124,20 @@ drawSatelliteWindow(satellite& sat)
|
|
|
|
|
ImGui::Text("flight path angle: %f", sat.gamma); |
|
|
|
|
ImGui::Dummy(V_SPACER); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void drawSystemWindow(system_2body& sys) |
|
|
|
|
void drawSystemWindow(system_2body& sys, bool& running) |
|
|
|
|
{ |
|
|
|
|
if (ImGui::CollapsingHeader("2 Body System:", H_FLAGS)) { |
|
|
|
|
if (ImGui::Button("||")) running = false; |
|
|
|
|
ImGui::SameLine(); |
|
|
|
|
if (ImGui::Button("|>")) running = true; |
|
|
|
|
ImGui::SameLine(); |
|
|
|
|
ImGui::Text("running: %s", (running > 0) ? "true" : "false"); |
|
|
|
|
|
|
|
|
|
ImGui::Text("time_step:"); |
|
|
|
|
ImGui::SameLine(); |
|
|
|
|
uint step = 1; |
|
|
|
|
ImGui::InputScalar("##other.time_step", |
|
|
|
|
ImGuiDataType_U32, |
|
|
|
|
&sys.time_step, &step |
|
|
|
|
); |
|
|
|
|
ImGui::InputDouble("##", &sys.time_step, 1); |
|
|
|
|
ImGui::Text("epsilon, spec. orb. energy: %f", sys.epsilon); |
|
|
|
|
ImGui::Text("h, angular momentum: %f", sys.h); |
|
|
|
|
ImGui::Text("r_apoapsis: %f", sys.r_apoapsis); |
|
|
|
|
|