too much fixes
This commit is contained in:
+4
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user