Attempt to fix "Regression in friction and damping behaviour" , see issue 752

Thanks to Sergej Reich for the report and narrowing down the breaking revision!
This commit is contained in:
erwin.coumans@gmail.com
2013-10-22 09:26:08 +00:00
parent 5e372d6ac5
commit a21480c8ca
5 changed files with 84 additions and 58 deletions

View File

@@ -118,8 +118,8 @@ ATTRIBUTE_ALIGNED16 (struct) btSolverBody
btVector3 m_turnVelocity;
btVector3 m_linearVelocity;
btVector3 m_angularVelocity;
btVector3 m_externalForce;
btVector3 m_externalTorque;
btVector3 m_externalForceImpulse;
btVector3 m_externalTorqueImpulse;
btRigidBody* m_originalBody;
void setWorldTransform(const btTransform& worldTransform)
@@ -132,6 +132,17 @@ ATTRIBUTE_ALIGNED16 (struct) btSolverBody
return m_worldTransform;
}
SIMD_FORCE_INLINE void getVelocityInLocalPointNoDelta(const btVector3& rel_pos, btVector3& velocity ) const
{
if (m_originalBody)
velocity = m_linearVelocity + m_externalForceImpulse + (m_angularVelocity+m_externalTorqueImpulse).cross(rel_pos);
else
velocity.setValue(0,0,0);
}
SIMD_FORCE_INLINE void getVelocityInLocalPointObsolete(const btVector3& rel_pos, btVector3& velocity ) const
{
if (m_originalBody)