improve dynamic friction
This commit is contained in:
@@ -36,17 +36,17 @@ void btDeformableBodySolver::solveConstraints(float solverdt)
|
||||
|
||||
// add constraints to the solver
|
||||
setConstraints();
|
||||
|
||||
m_objective->computeResidual(solverdt, m_residual);
|
||||
m_objective->projectFriction(m_residual);
|
||||
m_objective->applyDynamicFriction(m_residual);
|
||||
computeStep(m_dv, m_residual);
|
||||
|
||||
updateVelocity();
|
||||
}
|
||||
|
||||
void btDeformableBodySolver::computeStep(TVStack& dv, const TVStack& residual)
|
||||
{
|
||||
|
||||
btScalar tolerance = std::numeric_limits<float>::epsilon()* 1024 * m_objective->computeNorm(residual);
|
||||
btScalar tolerance = std::numeric_limits<float>::epsilon() * m_objective->computeNorm(residual);
|
||||
m_cg.solve(*m_objective, dv, residual, tolerance);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ void btDeformableBodySolver::setConstraints()
|
||||
{
|
||||
BT_PROFILE("setConstraint");
|
||||
m_objective->setConstraints();
|
||||
for (int i = 0; i < 1; ++i)
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
m_objective->projection.update();
|
||||
m_objective->enforceConstraint(m_dv);
|
||||
|
||||
Reference in New Issue
Block a user