PhysicsEntity::on_collision will now be called for contacts

This commit is contained in:
Sara 2023-10-25 12:18:17 +02:00
parent 979b7cd83b
commit 23454d3065

View file

@ -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)");