1#ifndef FLIGHTSIMULATOR_H
2#define FLIGHTSIMULATOR_H
27 std::shared_ptr<Environment> environment);
39 void run(
double maxSimulationTime,
double timeStep);
67 void step(
double deltaTime);
Models atmospheric and gravitational conditions for the flight simulation.
Definition Environment.h:10
~FlightSimulator()=default
Default destructor.
bool checkTermination(const FlightState &state)
Checks if simulation termination conditions are met (e.g., landed).
Definition FlightSimulator.cpp:94
std::unique_ptr< Integrator > integrator_
Integrates equations of motion.
Definition FlightSimulator.h:52
FlightSimulator(std::shared_ptr< Rocket > rocket, std::shared_ptr< Environment > environment)
Constructs a new FlightSimulator.
Definition FlightSimulator.cpp:15
void run(double maxSimulationTime, double timeStep)
Runs the full flight simulation.
Definition FlightSimulator.cpp:26
void handleEvents(FlightState &state)
Detects and processes key events (burnout, separation, recovery).
Definition FlightSimulator.cpp:90
void updateMotors(double deltaTime)
Definition FlightSimulator.cpp:82
const std::vector< FlightState > & getFlightLog() const
Returns the recorded flight states over time.
Definition FlightSimulator.cpp:54
bool hasLaunched_
Have we left the lauch pad/rail?
Definition FlightSimulator.h:56
void step(double deltaTime)
Advances the simulation by one time step.
Definition FlightSimulator.cpp:64
std::shared_ptr< ForcesModel > forcesModel_
Computes forces and moments on the rocket.
Definition FlightSimulator.h:51
std::shared_ptr< Rocket > rocket_
Rocket being simulated.
Definition FlightSimulator.h:48
std::shared_ptr< Environment > environment_
Atmospheric and gravity conditions.
Definition FlightSimulator.h:49
std::vector< FlightState > flightLog_
Time history of flight state snapshots.
Definition FlightSimulator.h:54
void initialize()
Initializes simulation (prepare rocket, set initial conditions).
Definition FlightSimulator.cpp:60
Represents the physical state of the rocket at a given simulation time.
Definition FlightState.h:12
Computes aerodynamic, thrust, and gravitational forces acting on the rocket.
Definition ForcesModel.h:17
Advances the rocket's flight state using numerical integration.
Definition Integrator.h:18
Represents a complete rocket vehicle composed of stages, motors, and recovery systems.
Definition Rocket.h:20