Gravity something works idk

This commit is contained in:
h3cx committed 2026-09-30 23:46:14 +02:00
1 parent aa4f0dfe52
commit d4987568d7
4 files changed
+59 -36

No files matched your search

+3 -3
View File
@@ -48,8 +48,8 @@ void collide(mass_body_t *a, mass_body_t *b, const Vector2 normal,
}
void collide_rigid(mass_body_t *a, float restitution) {
float max_x = GetRenderWidth() * 10 / 2.0f - a->radius;
float max_y = GetRenderHeight() * 10 / 2.0f - a->radius;
float max_x = GetRenderWidth() * 100 / 2.0f - a->radius;
float max_y = GetRenderHeight() * 100 / 2.0f - a->radius;
if (a->position.x > max_x) {
a->position.x = max_x;
@@ -86,7 +86,7 @@ void mechanics(universe_t *uni) {
body_2 = uni->bodies[y];
collision = body_collision(&body_1, &body_2);
if (!vec2_is_null(collision)) {
collide(&body_1, &body_2, collision, 1.0);
collide(&body_1, &body_2, collision, 0.99);
}
uni->bodies[y] = body_2;
}