From b8ae02109a103305c2fd6bda5e637a2f6af1d499 Mon Sep 17 00:00:00 2001 From: Sara <sara@saragerretsen.nl> Date: Thu, 19 Oct 2023 13:50:35 +0200 Subject: [PATCH] collision relative velocity is now calculated in one line --- src/collision.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/collision.c b/src/collision.c index 15bd2d9..dfe646c 100644 --- a/src/collision.c +++ b/src/collision.c @@ -86,8 +86,7 @@ int _internal_collision_get_overlap(PhysicsEntity self, PhysicsEntity other, Col RigidBody* rba = self.tc->get_rigidbody(self.data); RigidBody* rbb = other.tc->get_rigidbody(other.data); - Vector velocity = rigidbody_get_velocity(rba); - velocity = vsubf(velocity, rigidbody_get_velocity(rbb)); + Vector velocity = vsubf(rigidbody_get_velocity(rba), rigidbody_get_velocity(rbb)); *out = (Collision) { .other = other,