Antkeeper  0.0.1
Public Member Functions | List of all members
orbit_system Class Reference

Updates the Cartesian position and velocity of orbiting bodies given their Keplerian orbital elements and the current time. More...

#include <orbit-system.hpp>

Inheritance diagram for orbit_system:
updatable_system

Public Member Functions

 orbit_system (entity::registry &registry)
 
 ~orbit_system ()
 
virtual void update (float t, float dt)
 Scales then adds the timestep dt to the current time, then recalculates the positions of orbiting bodies. More...
 
void set_time (double time)
 Sets the current time. More...
 
void set_time_scale (double scale)
 Sets the factor by which the timestep dt will be scaled before being added to the current time. More...
 
void set_ephemeris (std::shared_ptr< physics::orbit::ephemeris< double >> ephemeris)
 Sets the ephemeris used to calculate orbital positions. More...
 
- Public Member Functions inherited from updatable_system
 updatable_system (entity::registry &registry)
 Creates an updatable system. More...
 

Additional Inherited Members

- Protected Attributes inherited from updatable_system
entity::registryregistry
 Registry on which the system operate. More...
 

Detailed Description

Updates the Cartesian position and velocity of orbiting bodies given their Keplerian orbital elements and the current time.

Definition at line 33 of file orbit-system.hpp.

Constructor & Destructor Documentation

◆ orbit_system()

orbit_system::orbit_system ( entity::registry registry)
explicit

Definition at line 24 of file orbit-system.cpp.

◆ ~orbit_system()

orbit_system::~orbit_system ( )

Definition at line 34 of file orbit-system.cpp.

Member Function Documentation

◆ set_ephemeris()

void orbit_system::set_ephemeris ( std::shared_ptr< physics::orbit::ephemeris< double >>  ephemeris)

Sets the ephemeris used to calculate orbital positions.

Parameters
ephemerisEphemeris.

Definition at line 70 of file orbit-system.cpp.

◆ set_time()

void orbit_system::set_time ( double  time)

Sets the current time.

Parameters
timeTime, in days.

Definition at line 76 of file orbit-system.cpp.

◆ set_time_scale()

void orbit_system::set_time_scale ( double  scale)

Sets the factor by which the timestep dt will be scaled before being added to the current time.

Parameters
scaleFactor by which to scale the timestep.

Definition at line 81 of file orbit-system.cpp.

◆ update()

void orbit_system::update ( float  t,
float  dt 
)
virtual

Scales then adds the timestep dt to the current time, then recalculates the positions of orbiting bodies.

Parameters
tTime, in seconds.
dtDelta time, in seconds.

Implements updatable_system.

Definition at line 40 of file orbit-system.cpp.


The documentation for this class was generated from the following files: