Apply the additional rotation to be applied to a body also

to the interpolated world transform. This fixes a bug for
rotations that are applied only once, since kart.cpp would
use the interpolated world transform, which is otherwise
not updated till the next time step, resulting in a jump
of the kart rotation.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10706 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2012-01-23 05:37:21 +00:00
parent 51468de16e
commit 0836380d9e

View File

@@ -448,10 +448,13 @@ void btKart::updateVehicle( btScalar step )
float dt = step > m_time_additional_rotation
? m_time_additional_rotation
: step;
t.setRotation(t.getRotation()
*btQuaternion(m_additional_rotation.getY()*dt,
m_additional_rotation.getX()*dt,
m_additional_rotation.getZ()*dt));
btQuaternion add_rot(m_additional_rotation.getY()*dt,
m_additional_rotation.getX()*dt,
m_additional_rotation.getZ()*dt);
t.setRotation(t.getRotation()*add_rot);
m_chassisBody->setWorldTransform(t);
btTransform &iwt=m_chassisBody->getInterpolationWorldTransform();
iwt.setRotation(iwt.getRotation()*add_rot);
m_time_additional_rotation -= step;
}
} // updateVehicle