|
|
|
@ -8,7 +8,8 @@ |
|
|
|
#include <cmath> |
|
|
|
#include <cmath> |
|
|
|
|
|
|
|
|
|
|
|
// Configuration defaults - edit to change default run mode
|
|
|
|
// Configuration defaults - edit to change default run mode
|
|
|
|
#define DEFAULT_CONFIG_FILE "configs/test_simple.toml" |
|
|
|
//#define DEFAULT_CONFIG_FILE "configs/test_simple.toml"
|
|
|
|
|
|
|
|
#define DEFAULT_CONFIG_FILE "tests/configs/solar_system.toml" |
|
|
|
|
|
|
|
|
|
|
|
struct ProgramArgs { |
|
|
|
struct ProgramArgs { |
|
|
|
const char* config_file; |
|
|
|
const char* config_file; |
|
|
|
@ -64,7 +65,18 @@ void run_gui_simulation(SimulationState* sim) { |
|
|
|
printf("Speed multiplier: %.1fx\n", speed_multiplier); |
|
|
|
printf("Speed multiplier: %.1fx\n", speed_multiplier); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0 |
|
|
|
|
|
|
|
/****
|
|
|
|
|
|
|
|
* Hacks ahead... |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
int focus_index = 9; |
|
|
|
|
|
|
|
if (sim->body_count >= focus_index) { |
|
|
|
|
|
|
|
Vector3 offset = {0, 100, 100}; |
|
|
|
|
|
|
|
focus_camera(&render_state, &sim->bodies[focus_index], offset); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#else |
|
|
|
update_camera(&render_state); |
|
|
|
update_camera(&render_state); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
if (!paused) { |
|
|
|
if (!paused) { |
|
|
|
int steps = (int)(physics_steps_per_frame * speed_multiplier); |
|
|
|
int steps = (int)(physics_steps_per_frame * speed_multiplier); |
|
|
|
|