diff --git a/src/rigidbody.c b/src/rigidbody.c index 35e77ae..f272e19 100644 --- a/src/rigidbody.c +++ b/src/rigidbody.c @@ -102,10 +102,10 @@ Vector _internal_calculate_contact_force(Contact* contact) { if(vsqrmagnitudef(hit.separation_force) < powf(0.01f, 2)) return ZeroVector; - const float warming = 100.f * fminf(1.f, contact->warming); + const float warming = fminf(1.f, contact->warming * 100.f); const float d = 1.0f; - const float k = 0.0f * warming; - const float b = 1.0f; + const float k = 0.001f; + const float b = 1.0f * warming; const Vector damping = vmulff(hit.normal, k * d); const Vector bounce = vprojectf(vmulff(hit.normal, -b), hit.velocity); @@ -118,8 +118,8 @@ void _internal_rigidbody_solve_contact(RigidBody* self, Contact* contact, Vector Collision hit = contact->hit; if(vdotf(hit.normal, self->linear_velocity) > 0.0) return; - if (vsqrmagnitudef(contact->hit.separation_force) < 0.001f*0.001f) - return; + // if (vsqrmagnitudef(contact->hit.separation_force) < 0.001f*0.001f) + // return; float normalmag = vmagnitudef(contact->hit.normal); ASSERT_RETURN(fabsf(normalmag - 1.f) < 0.99999f,, "Normal of collision not one");