add relative tolerance for linear solver and newton with line search
This commit is contained in:
@@ -72,6 +72,24 @@ public:
|
||||
{
|
||||
return BT_GRAVITY_FORCE;
|
||||
}
|
||||
|
||||
virtual double totalElasticEnergy()
|
||||
{
|
||||
double e = 0;
|
||||
for (int i = 0; i<m_softBodies.size();++i)
|
||||
{
|
||||
btSoftBody* psb = m_softBodies[i];
|
||||
for (int j = 0; j < psb->m_nodes.size(); ++j)
|
||||
{
|
||||
const btSoftBody::Node& node = psb->m_nodes[j];
|
||||
if (node.m_im > 0)
|
||||
{
|
||||
e -= m_gravity.dot(node.m_q)/node.m_im;
|
||||
}
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user