Solar system in main

This commit is contained in:
Pierre Barbier committed 2026-10-01 11:18:38 +02:00
1 parent ff3dcfcf8e
commit 2a7669aa21
2 files changed
+15 -9

No files matched your search

+12 -8
View File
@@ -1,11 +1,8 @@
#define _POSIX_C_SOURCE 200809L
#include "consts.h"
#include "gravity.h"
#include "mechanics.h"
<<<<<<< HEAD
#include "magnetism.h"
=======
#include "objects.h"
#include "vec_utils.h"
#include <bits/time.h>
@@ -63,15 +60,22 @@ int main(void) {
const char *welcome_text = "Welcome to Fucked Physics!";
universe_t universe = {0, NULL};
universe.bodies = malloc(1024 * sizeof(mass_body_t));
universe.num_bodies = 3;
universe.num_bodies = 5;
universe.bodies[0] =
(mass_body_t){10000000000000.0f, 1000, {-0, 0}, {0, 0}, 200};
(mass_body_t){330432.0f, 696, {-0, 0}, {0, 0}, 696};
universe.bodies[1] =
(mass_body_t){100000000.0f, 0.1, {-10000.1, 0}, {0, -0.2}, 50};
(mass_body_t){0.055f, 2.439, {0.387*UA/RT, 0}, {0, -38.86/RT}, 50};
universe.bodies[2] =
(mass_body_t){100000000.0f, 0.1, {10000, 0}, {0, -0.2}, 50};
(mass_body_t){0.815f, 0.1, {0.723*UA/RT, 0}, {0, -34.79/RT}, 50};
universe.bodies[3] =
(mass_body_t){1.0f, 0.1, {1*UA/RT, 0}, {0, -29.29/RT}, 50};
universe.bodies[4] =
(mass_body_t){0.107f, 200, {1.524*UA/RT, 0}, {0, -21.97/RT}, 200};
universe.bodies[5] =
(mass_body_t){317.83f, 0.1, {5.203*UA/RT, 0}, {0, -12.43/RT}, 50};
universe.bodies[6] =
(mass_body_t){95.159f, 200, {9.582*UA/RT, 0}, {0, -9.11/RT}, 200};
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
InitWindow(800, 450, "Fucked Physics");
SetTargetFPS(120);