|
|
|
|
@ -42,42 +42,59 @@ gooProcessEvent(SDL_Event& e)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
gooDraw(SDL_Window* window, orbital_elements& orbit) |
|
|
|
|
gooDraw(SDL_Window* window, orbital_elements& orbit, uint& time_step) |
|
|
|
|
{ |
|
|
|
|
// Start the Dear ImGui frame
|
|
|
|
|
ImGui_ImplOpenGL3_NewFrame(); |
|
|
|
|
ImGui_ImplSDL2_NewFrame(window); |
|
|
|
|
ImGui::NewFrame(); |
|
|
|
|
|
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(0,0)); |
|
|
|
|
ImGui::SetNextWindowSize(ImVec2(300,270)); |
|
|
|
|
const static int w = 300; |
|
|
|
|
int x = 0, y = 0; |
|
|
|
|
SDL_GetWindowSize(window, &x, &y); |
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(x - w, 0)); |
|
|
|
|
ImGui::SetNextWindowSize(ImVec2(w, y)); |
|
|
|
|
ImGui::Begin("Orbital Elements"); |
|
|
|
|
|
|
|
|
|
ImGui::Text("iota, inclination: %f", orbit.iota); |
|
|
|
|
ImGui::Text("omega, argument of periapsis: %f", orbit.omega); |
|
|
|
|
ImGui::Text("mu, gravitational parameter: %f", orbit.mu); |
|
|
|
|
ImGui::Text("nu, true anomoly: %f", orbit.nu); |
|
|
|
|
ImGui::Text("nu, true anomoly: "); |
|
|
|
|
ImGui::InputDouble("##orbit.nu", &orbit.nu, 0.1f); |
|
|
|
|
ImGui::SameLine(); |
|
|
|
|
ImGui::Text(" radians"); |
|
|
|
|
ImGui::Spacing(); |
|
|
|
|
|
|
|
|
|
ImGui::Separator(); |
|
|
|
|
ImGui::Spacing(); |
|
|
|
|
ImGui::Text("Ellipse Parameters:"); |
|
|
|
|
ImGui::Text("a: %f km", orbit.ep.a); |
|
|
|
|
ImGui::Text("b: %f km", orbit.ep.b); |
|
|
|
|
ImGui::Text("e: %f", orbit.ep.e); |
|
|
|
|
ImGui::Text("c: %f km", orbit.ep.c); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("a:"); |
|
|
|
|
ImGui::SameLine(); |
|
|
|
|
ImGui::Text("semi-major axis, a: "); |
|
|
|
|
ImGui::InputDouble("##orbit.ep.a", &orbit.ep.a, 1000.0f); |
|
|
|
|
|
|
|
|
|
ImGui::Text("e:"); |
|
|
|
|
ImGui::SameLine(); |
|
|
|
|
ImGui::Text(" km"); |
|
|
|
|
ImGui::Text("semi-minor axis, b: %f km", orbit.ep.b); |
|
|
|
|
ImGui::Text("eccentricity, e: "); |
|
|
|
|
ImGui::InputDouble("##orbit.ep.e", &orbit.ep.e, 0.01f); |
|
|
|
|
ImGui::Text("linear eccentricity, c: %f km", orbit.ep.c); |
|
|
|
|
ImGui::Spacing(); |
|
|
|
|
|
|
|
|
|
ImGui::End(); |
|
|
|
|
ImGui::Separator(); |
|
|
|
|
ImGui::Spacing(); |
|
|
|
|
ImGui::Text("Other Parameters"); |
|
|
|
|
ImGui::Spacing(); |
|
|
|
|
ImGui::Text("time_step:"); |
|
|
|
|
ImGui::SameLine(); |
|
|
|
|
uint step = 1; |
|
|
|
|
ImGui::InputScalar("##other.time_step", ImGuiDataType_U32, &time_step, &step); |
|
|
|
|
ImGui::Spacing(); |
|
|
|
|
ImGui::Text("Satellite Parameters:"); |
|
|
|
|
ImGui::Text("position:"); |
|
|
|
|
ImGui::Text(" x: %f km", orbit.pos.x); |
|
|
|
|
ImGui::Text(" y: %f km", orbit.pos.y); |
|
|
|
|
ImGui::Text(" z: %f km", orbit.pos.z); |
|
|
|
|
ImGui::Text("radial velocity:"); |
|
|
|
|
ImGui::Text("flight path angle:"); |
|
|
|
|
|
|
|
|
|
ImGui::End(); |
|
|
|
|
ImGui::Render(); |
|
|
|
|
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); |
|
|
|
|
} |
|
|
|
|
|