49 for (
int i: ephemeris_indices)
50 positions[i] = ephemeris->trajectories[i].position(time) * 1000.0;
57 orbit.position = positions[orbit.ephemeris_index] * orbit.scale;
60 while (parent_id != entt::null)
64 parent_id = parent_orbit.
parent;
72 this->ephemeris = ephemeris;
73 positions.resize((ephemeris) ? ephemeris->trajectories.size() : 0);
89 ephemeris_indices.insert(component.ephemeris_index);
95 ephemeris_indices.insert(component.ephemeris_index);
void set_time_scale(double scale)
Sets the factor by which the timestep dt will be scaled before being added to the current time.
void set_time(double time)
Sets the current time.
virtual void update(float t, float dt)
Scales then adds the timestep dt to the current time, then recalculates the positions of orbiting bod...
void set_ephemeris(std::shared_ptr< physics::orbit::ephemeris< double >> ephemeris)
Sets the ephemeris used to calculate orbital positions.
orbit_system(entity::registry ®istry)
Abstract base class for updatable systems.
entity::registry & registry
Registry on which the system operate.
entt::registry registry
Component registry type.
entt::entity id
Entity ID type.
constexpr mat4< T > scale(const vec3< T > &v)
Constructs a scale matrix.
int ephemeris_index
Index of the orbit in the ephemeris.
math::dvec3 position
Cartesian position of the orbit, w.r.t. the ICRF frame.
entity::id parent
Entity ID of the parent orbit.
double scale
Orbit scale, for two-body orbits with one ephemeris item.
Table of orbital trajectories.