Applied missing patch from trunk that applies the force only sideways.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/physics@10280 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -752,6 +752,15 @@ void btKart::updateFriction(btScalar timeStep)
|
||||
(btRigidBody*) m_wheelInfo[wheel].m_raycastInfo.m_groundObject;
|
||||
btVector3 rel_pos2 = wheelInfo.m_raycastInfo.m_contactPointWS
|
||||
- groundObject->getCenterOfMassPosition();
|
||||
//adjust relative position above ground so that force only
|
||||
// acts sideways
|
||||
btVector3 delta_vec = (wheelInfo.m_raycastInfo.m_hardPointWS
|
||||
- wheelInfo.m_raycastInfo.m_contactPointWS);
|
||||
if (delta_vec.length() != btScalar (0))
|
||||
{
|
||||
delta_vec = delta_vec.normalize();
|
||||
rel_pos -= delta_vec * rel_pos.dot(delta_vec);
|
||||
}
|
||||
|
||||
btVector3 sideImp = m_axle[wheel] * m_sideImpulse[wheel];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user