new_velocity_vector = old_velocity_vector * dt
I thought I would update the speed this way:
Code: Select all
...
while (! this-> mShutDown) {
mKeyboard-> capture ();
mMouse-> capture ();
dynamicsWorld-> stepSimulation (1/60.f, 10);
for (int k = 1; k < this-> bodies_.size () k ++) {
btScalar x = vel.getX () * dt;
btScalar y = vel.getY () * dt;
btScalar z = vel.getZ () * dt
this-> bodies_ [k] -> setLinearVelocity (btVector3 (x, y, z));
}
mroot-> renderOneFrame ();
}
...