diff --git a/src/physics_entity.c b/src/physics_entity.c index c56ae93..5145ede 100644 --- a/src/physics_entity.c +++ b/src/physics_entity.c @@ -45,7 +45,7 @@ int _internal_default_contact_solver(RigidBody* body, Contact* contact, Transfor Transform* trans = rigidbody_get_transform(body); const Vector world_collision_point = vaddf(transform_point(&pre_solve, hit.point), hit.penetration_vector); const float current_dot = vdotf(hit.normal, vsubf(transform_point(trans, hit.point), world_collision_point)); - if(current_dot >= 0.0) + if(current_dot >= -0.0001) return 1; // the desired position is anywhere the overlapping vertex is further along the normal than the contact point const Vector target = vaddf(trans->position, vmulff(hit.normal, -current_dot));