too much fixes

This commit is contained in:
2026-10-18 12:07:20 -04:00
parent d84d59a444
commit 380e59c285
4 changed files with 48 additions and 37 deletions
+4 -2
View File
@@ -64,8 +64,10 @@ void Physics::Step(float dt)
if (!body->lockRotation)
body->angularvelocity += (ComputeInvInertiaTensor(body) * body->torque) * dt;
body->linearvelocity *= PHYSICS_LINEAR_DAMPING;
body->angularvelocity *= PHYSICS_ANGULAR_DAMPING;
// The damping constants are per 1/60 s step; rescale so drag doesn't depend on frame rate
const float steps = dt * 60.0f;
body->linearvelocity *= std::pow(PHYSICS_LINEAR_DAMPING, steps);
body->angularvelocity *= std::pow(PHYSICS_ANGULAR_DAMPING, steps);
body->force = glm::vec3(0.0f);
body->torque = glm::vec3(0.0f);