Bugfixes: update MaxSpeed(dt=0) (which updates additional engine power

and slowdowns correctly). Call proceedToTransform after updating
the velocities (which are read).
This commit is contained in:
hiker
2016-09-21 17:28:26 +10:00
parent f09ed569cc
commit 15660f2d7a

View File

@@ -111,9 +111,11 @@ void KartRewinder::rewindToState(BareNetworkString *buffer)
t.setOrigin(buffer->getVec3());
t.setRotation(buffer->getQuat());
btRigidBody *body = getBody();
body->proceedToTransform(t);
body->setLinearVelocity(buffer->getVec3());
body->setAngularVelocity(buffer->getVec3());
// This function also reads the velocity, so it must be called
// after the velocities are set
body->proceedToTransform(t);
m_has_started = buffer->getUInt8()!=0; // necessary for startup speed boost
m_vehicle->instantSpeedIncreaseTo(buffer->getFloat());
@@ -132,6 +134,7 @@ void KartRewinder::rewindToState(BareNetworkString *buffer)
// 5) Max speed info
// ------------------
m_max_speed->rewindTo(buffer);
m_max_speed->update(0);
// 6) Skidding
// -----------