const char * scenario_name(Scenario s)
@ BinaryPlus
Equal-mass binary + one test particle on a wide orbit.
@ Galaxy
Random N bodies — gravity only, bodies merge on contact.
@ Figure8
Chenciner-Montgomery figure-8 choreography (3 equal masses)
@ SolarSystem
Sun + 4 planets on circular Keplerian orbits.
ODE time integrators: Euler, RK4, adaptive RK45 (Dormand-Prince), and symplectic Velocity Verlet / Yo...
float phys_radius
physics-unit radius for merge detection (0 = disabled)
uint32_t color
RGBA packed (raylib Color layout)
double kinetic_energy() const
double potential_energy() const
void step(double dt)
Advance by exactly one time step dt.
num::Vector q
Positions: [x0,y0, x1,y1, ...].
bool use_verlet
true = Verlet (symplectic), false = RK4
void make_accel(const num::Vector &pos, num::Vector &acc) const
Fill acc from current positions (gravitational acceleration on each body).
void reset(Scenario s)
Reset to a preset scenario.
double total_energy() const
num::Vector v
Velocities: [vx0,vy0, vx1,vy1, ...].
std::vector< std::pair< int, int > > check_merges()
double energy_drift() const
Relative energy drift since reset: (E - E0) / |E0|.
std::vector< Body > bodies
double E0
Initial total energy (for drift tracking)
double soft
Softening length (avoids singularities)
bool enable_merges
true = check_merges() is active (Galaxy scenario)