Patch#
-
class Patch#
A patch of the trajectory, at its position in
patches().Note
Trajectories computes the trajectory again as the vessel flies, and the patch reads the latest one. Throws an exception if the trajectory has fewer patches.
-
std::optional<std::tuple<double, double, double>> position(SpaceCenter::ReferenceFrame reference_frame)#
The position of the impact, or
NULLwithout one.- Parameters:
reference_frame – The reference frame for the position.
- Game Scenes:
Flight
Note
In a reference frame that rotates with
Patch::body(), the position includes the rotation of the body until the impact.
-
std::optional<std::tuple<double, double, double>> velocity(SpaceCenter::ReferenceFrame reference_frame)#
The velocity at the impact, or
NULLwithout one.- Parameters:
reference_frame – The reference frame for the velocity.
- Game Scenes:
Flight
Note
In a reference frame that rotates with
Patch::body(), the velocity includes the rotation of the body until the impact.
-
SpaceCenter::CelestialBody body()#
The celestial body that the patch is relative to.
- Game Scenes:
Flight
-
double start_ut()#
The universal time at the start of the patch, in seconds.
- Game Scenes:
Flight
-
double end_ut()#
The universal time at the end of the patch, in seconds.
- Game Scenes:
Flight
Note
For a patch that ends in an impact, this is the time of the impact.
-
bool atmospheric()#
Whether the patch is inside an atmosphere.
- Game Scenes:
Flight
-
std::optional<std::vector<std::tuple<double, double, double, double>>> atmospheric_trajectory(SpaceCenter::ReferenceFrame reference_frame)#
The points of an atmospheric patch, or
NULLfor a patch in space.- Parameters:
reference_frame – The reference frame for the positions.
- Game Scenes:
Flight
Note
Each point is a tuple
(ut, x, y, z). In a reference frame that rotates withPatch::body(), the positions include the rotation of the body until each point.
-
std::optional<SpaceCenter::Orbit> orbital_trajectory()#
The orbit of a patch in space, or
NULLfor an atmospheric patch.- Game Scenes:
Flight
-
std::optional<std::tuple<double, double, double>> position(SpaceCenter::ReferenceFrame reference_frame)#