Browse Source

Fix enum and struct styling in orbital_objects.h

- Convert typedef enum to C++ style enum
- Convert typedef struct to C++ style struct {}
- Add RendezvousState type to RendezvousTarget::state field
- Update comments to one-liners with inline descriptions
- Remove redundant struct names from comments
main
cinnaboot 3 months ago
parent
commit
1bb7c820d7
  1. 45
      src/orbital_objects.h

45
src/orbital_objects.h

@ -11,52 +11,29 @@ struct SimulationState;
// Rendezvous Types
// ============================================================================
/**
* Rendezvous state machine
*
* States:
* - NONE: No rendezvous active
* - PLANNING: Target selected, approaching
* - APPROACHING: Closing in on target
* - MATCHING: Velocity matching phase
* - COMPLETE: Rendezvous successful
* - FAILED: Rendezvous failed
*/
typedef enum {
enum RendezvousState {
RENDEZVOUS_NONE,
RENDEZVOUS_PLANNING,
RENDEZVOUS_APPROACHING,
RENDEZVOUS_MATCHING,
RENDEZVOUS_COMPLETE,
RENDEZVOUS_FAILED
} RendezvousState;
/**
* Rendezvous target structure
*
* Tracks the active rendezvous target and state for a spacecraft
*/
typedef struct {
};
struct RendezvousTarget { // Active rendezvous target configuration
int target_index; // Index of target spacecraft/body
int state; // RendezvousState
RendezvousState state; // Current rendezvous state
double approach_distance; // Distance to start approach phase (m)
double capture_distance; // Distance for capture (m)
double max_relative_velocity; // Max closing speed for capture (m/s)
double cw_linearization_time; // Last time CW equations were linearized (s)
bool is_spacecraft_target; // True if target is spacecraft, false if body
} RendezvousTarget;
};
// ============================================================================
// Celestial Body Structure
/**
* Celestial Body Structure
*
* Represents a planet, star, moon, or other gravitational body
* in the simulation. Supports hierarchical orbital mechanics with
* parent-child relationships and sphere of influence calculations.
*/
struct CelestialBody {
struct CelestialBody { // Gravitational body in the simulation
char name[64];
double mass; // kg
double radius; // meters
@ -77,13 +54,7 @@ struct CelestialBody {
double soi_radius; // sphere of influence radius (meters)
};
/**
* Spacecraft Structure
*
* Represents a spacecraft or probe in the simulation.
* Supports orbital mechanics, maneuvers, and rendezvous operations.
*/
struct Spacecraft {
struct Spacecraft { // Spacecraft or probe in the simulation
char name[64];
double mass;
int parent_index;

Loading…
Cancel
Save