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:
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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user