Browse Source

fix frame-rate-dependent jumping

David Rose 22 years ago
parent
commit
626e13f485
1 changed files with 2 additions and 2 deletions
  1. 2 2
      panda/src/physics/linearEulerIntegrator.cxx

+ 2 - 2
panda/src/physics/linearEulerIntegrator.cxx

@@ -185,10 +185,10 @@ child_integrate(Physical *physical,
     
     
     accel_vec*=viscosityDamper;
     accel_vec*=viscosityDamper;
     
     
-    // v = v + a * t
-    vel_vec += accel_vec * dt;
     // x = x + v * t + 0.5 * a * t * t
     // x = x + v * t + 0.5 * a * t * t
     pos += vel_vec * dt + 0.5 * accel_vec * dt * dt;
     pos += vel_vec * dt + 0.5 * accel_vec * dt * dt;
+    // v = v + a * t
+    vel_vec += accel_vec * dt;
     #endif //]
     #endif //]
     
     
     // and store them back.
     // and store them back.