From 8c78395219c246b52df2b3cc710ca93498f0a5ba Mon Sep 17 00:00:00 2001 From: Sara Date: Sat, 7 Oct 2023 18:39:57 +0200 Subject: [PATCH] changed other type of collision to PhysicsEntity and added separation force --- src/collision.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/collision.h b/src/collision.h index 7e1a953..5e4b9db 100644 --- a/src/collision.h +++ b/src/collision.h @@ -2,17 +2,19 @@ #define _fencer_collision_h #include "shape.h" +#include "physics_entity.h" #include -struct Collision { - Shape* other; - +typedef struct Collision { + PhysicsEntity other; Vector point; Vector normal; Vector velocity; - + Vector separation_force; size_t edge_left; size_t edge_right; -}; +} Collision; + +extern Collision get_collision(PhysicsEntity a, PhysicsEntity b); #endif // !_fencer_collision_h