moved call to apply forces to physics solver

This commit is contained in:
Sara 2023-10-25 11:25:35 +02:00
parent 1e2d9a7067
commit b487b2582e

View file

@ -63,6 +63,7 @@ void physics_entity_apply_collision_forces(PhysicsEntity self, List* contacts) {
}
void physics_entity_solve_contacts(PhysicsEntity self, List* contacts) {
physics_entity_apply_collision_forces(self, contacts);
RigidBody* body = self.tc->get_rigidbody(self.data);
const Transform pre_solve = *rigidbody_get_transform(body);
// attempt to solve constraints
@ -95,7 +96,6 @@ void physics_entity_update(PhysicsEntity self) {
List* contacts = rigidbody_get_contacts(body);
if(contacts->len > 0) {
physics_entity_apply_collision_forces(self, contacts);
self.tc->collision_solver(self.data, contacts);
}