From 1bb7c820d73757fae0c7b8af90058b1f34b694fd Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Wed, 8 Apr 2026 15:46:36 +0000 Subject: [PATCH] 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 --- src/orbital_objects.h | 45 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/src/orbital_objects.h b/src/orbital_objects.h index 6e7222c..c3ec70d 100644 --- a/src/orbital_objects.h +++ b/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;