Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
maneuver.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2023 Conquer Space
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <utility>
20
21#include <glm/vec3.hpp>
22
24
25// Basic satellite maneuvers
26namespace cqsp::common::systems {
27// Creates a manuever for a circular orbit at apogee, the new altitude of the entire orbit will be the apogee,
28// the maneuever will be at apogee
29std::pair<glm::dvec3, double> CircularizeAtApoapsis(const components::types::Orbit& orbit);
30// Creates a manuever for a circular orbit at perigee, new altitude will be perigee, the maneuver will be at the perigee
31std::pair<glm::dvec3, double> CircularizeAtPeriapsis(const components::types::Orbit& orbit);
32
33// Raises or lowers apogee to the new altitude. This will not check if you are colliding with the body :(
34// The burn will be at the periapsis
35std::pair<glm::dvec3, double> SetApoapsis(const components::types::Orbit& orbit, double altitude);
36// Raises or lowers perapsis to the new altitude. This will not check if you are colliding with the body
37// The burn will be at the apoapsis
38std::pair<glm::dvec3, double> SetPeriapsis(const components::types::Orbit& orbit, double altitude);
39// This will find the nearest point in the inclination that intersects with the orbital inclination plane 0 degrees.
40std::pair<glm::dvec3, double> SetInclination(const components::types::Orbit& orbit, double inclination);
41std::pair<glm::dvec3, double> SetCircularInclination(const components::types::Orbit& orbit, double inclination);
42std::pair<glm::dvec3, double> MatchPlanes(const components::types::Orbit& orbit,
43 const components::types::Orbit& target);
44} // namespace cqsp::common::systems
Definition: simulation.h:27
std::pair< glm::dvec3, double > SetPeriapsis(const Orbit &orbit, double altitude)
Definition: maneuver.cpp:49
std::pair< glm::dvec3, double > MatchPlanes(const Orbit &orbit, const Orbit &target)
Definition: maneuver.cpp:101
std::pair< glm::dvec3, double > SetInclination(const Orbit &orbit, double inclination)
Definition: maneuver.cpp:64
std::pair< glm::dvec3, double > SetCircularInclination(const Orbit &orbit, double inclination)
Definition: maneuver.cpp:82
std::pair< glm::dvec3, double > CircularizeAtApoapsis(const Orbit &orbit)
Definition: maneuver.cpp:25
std::pair< glm::dvec3, double > SetApoapsis(const Orbit &orbit, double altitude)
Definition: maneuver.cpp:42
std::pair< glm::dvec3, double > CircularizeAtPeriapsis(const Orbit &orbit)
Definition: maneuver.cpp:33