From 23454d3065026f40e66037d65820861396fdd57f Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 25 Oct 2023 12:18:17 +0200 Subject: [PATCH] PhysicsEntity::on_collision will now be called for contacts --- src/physics_entity.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/physics_entity.c b/src/physics_entity.c index 4fc4924..5f559d3 100644 --- a/src/physics_entity.c +++ b/src/physics_entity.c @@ -97,6 +97,8 @@ void physics_entity_update(PhysicsEntity self) { List* contacts = rigidbody_get_contacts(body); if(contacts->len > 0) { self.tc->collision_solver(self.data, contacts); + list_foreach(Contact, contact, contacts) + self.tc->on_collision(self.data, contact->hit); } ASSERT_RETURN(!visnanf(rigidbody_get_velocity(body)),, "Velocity is NaN (1)");