BGE patch: fix force application on soft body. Force is applied on each node, it must be reduced by the same extend.

This commit is contained in:
Benoit Bolsee 2008-09-29 17:46:25 +00:00
parent 2a331067cc
commit a1513a8c0f

@ -962,8 +962,12 @@ void CcdPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bo
body->applyCentralForce(force);
btSoftBody* soft = GetSoftBody();
if (soft)
{
// the force is applied on each node, must reduce it in the same extend
if (soft->m_nodes.size() > 0)
force /= soft->m_nodes.size();
soft->addForce(force);
}
}
}
}