Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
Loading...
Searching...
No Matches
nbody.h
Go to the documentation of this file.
1
13#ifndef NBODY_H
14#define NBODY_H
15
16#include "nbody_types.h"
17#include "sphere_types.h" /* Apporte la définition de SphereInstance */
18
19/* --- Initialisation --- */
24
25/* --- Boucle Principale (Run) --- */
29void nbody_step(NBodySim* sim, float delta_time);
30
34void nbody_update_time_scale(NBodySim* sim, float delta_time);
35
36/* --- Rendu --- */
42
46int nbody_get_count(const NBodySim* sim);
47
48/* --- Diagnostiques / Debug --- */
52float nbody_total_energy(const NBodySim* sim);
53
58
62float nbody_energy_drift(const NBodySim* sim);
63
68
69#endif /* NBODY_H */
int nbody_get_count(const NBodySim *sim)
Returns the number of active bodies.
void nbody_init_preset(NBodySim *sim)
Initializes the simulation with a preset solar system configuration.
float nbody_energy_drift_signed(const NBodySim *sim)
Signed energy drift.
void nbody_step(NBodySim *sim, float delta_time)
Advances the simulation by the given wall-clock delta time.
float nbody_total_energy(const NBodySim *sim)
Computes the total energy (kinetic + gravitational potential).
float nbody_energy_drift(const NBodySim *sim)
Returns the relative energy drift |E(t) - E₀| / |E₀|.
void nbody_write_instances(const NBodySim *sim, SphereInstance *out)
Writes current body positions and materials into a SphereInstance array.
void nbody_update_time_scale(NBodySim *sim, float delta_time)
Smoothly transitions time_scale toward target_time_scale.
float nbody_kinetic_energy(const NBodySim *sim)
Computes kinetic energy only: Σ ½ m v².
Pure-data type for per-instance sphere attributes.
State container for the N-body simulation.
Definition nbody_types.h:68
Per-instance data sent to the shader via an instanced VBO.
Definition sphere_types.h:25