Updated canvas size
This commit is contained in:
1 file changed
+3
-4
+3
-4
@@ -2,7 +2,6 @@
|
|||||||
#include "objects.h"
|
#include "objects.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
Vector2 body_collision(mass_body_t *a, mass_body_t *b) {
|
Vector2 body_collision(mass_body_t *a, mass_body_t *b) {
|
||||||
Vector2 diff = vec2_diff(&a->position, &b->position);
|
Vector2 diff = vec2_diff(&a->position, &b->position);
|
||||||
float len = vec2_len(diff);
|
float len = vec2_len(diff);
|
||||||
@@ -49,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) {
|
void collide_rigid(mass_body_t *a, float restitution) {
|
||||||
float max_x = GetRenderWidth() / 2.0f - a->radius;
|
float max_x = GetRenderWidth() * 10 / 2.0f - a->radius;
|
||||||
float max_y = GetRenderHeight() / 2.0f - a->radius;
|
float max_y = GetRenderHeight() * 10 / 2.0f - a->radius;
|
||||||
|
|
||||||
if (a->position.x > max_x) {
|
if (a->position.x > max_x) {
|
||||||
a->position.x = max_x;
|
a->position.x = max_x;
|
||||||
@@ -73,7 +72,7 @@ void collide_rigid(mass_body_t *a, float restitution) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mechanics(universe_t* uni){
|
void mechanics(universe_t *uni) {
|
||||||
mass_body_t body_1;
|
mass_body_t body_1;
|
||||||
mass_body_t body_2;
|
mass_body_t body_2;
|
||||||
Vector2 collision;
|
Vector2 collision;
|
||||||
|
|||||||
Reference in new issue
Block a user