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.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
maneuver.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2025 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
25
26// Basic satellite maneuvers
27namespace cqsp::common::systems {
28// Creates a manuever for a circular orbit at apogee, the new altitude of the entire orbit will be the apogee,
29// the maneuever will be at apogee
30components::Maneuver_t CircularizeAtApoapsis(const components::types::Orbit& orbit);
31// Creates a manuever for a circular orbit at perigee, new altitude will be perigee, the maneuver will be at the perigee
32components::Maneuver_t CircularizeAtPeriapsis(const components::types::Orbit& orbit);
33
34// Raises or lowers apogee to the new altitude. This will not check if you are colliding with the body :(
35// The burn will be at the periapsis
36components::Maneuver_t SetApoapsis(const components::types::Orbit& orbit, double altitude);
37// Raises or lowers perapsis to the new altitude. This will not check if you are colliding with the body
38// The burn will be at the apoapsis
39components::Maneuver_t SetPeriapsis(const components::types::Orbit& orbit, double altitude);
40// This will find the nearest point in the inclination that intersects with the orbital inclination plane 0 degrees.
41components::Maneuver_t SetInclination(const components::types::Orbit& orbit, double inclination);
42components::Maneuver_t SetCircularInclination(const components::types::Orbit& orbit, double inclination);
43components::Maneuver_t MatchPlanes(const components::types::Orbit& orbit, const components::types::Orbit& target);
44} // namespace cqsp::common::systems
std::pair< glm::dvec3, double > Maneuver_t
Definition: movement.h:26
Definition: simulation.cpp:51
std::pair< glm::dvec3, double > SetApoapsis(const Orbit &orbit, double altitude)
Definition: maneuver.cpp:42
std::pair< glm::dvec3, double > SetInclination(const Orbit &orbit, double inclination)
Definition: maneuver.cpp:64
std::pair< glm::dvec3, double > CircularizeAtApoapsis(const Orbit &orbit)
Definition: maneuver.cpp:25
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 > SetCircularInclination(const Orbit &orbit, double inclination)
Definition: maneuver.cpp:82
std::pair< glm::dvec3, double > CircularizeAtPeriapsis(const Orbit &orbit)
Definition: maneuver.cpp:33