turn on SVD and use fewer CG iterations

This commit is contained in:
Xuchen Han
2019-11-03 12:47:08 -08:00
parent 1bd0eee0ff
commit 4347c03459
2 changed files with 3 additions and 2 deletions

View File

@@ -18,7 +18,7 @@
#include "btDeformableBodySolver.h" #include "btDeformableBodySolver.h"
#include "btSoftBodyInternals.h" #include "btSoftBodyInternals.h"
#include "LinearMath/btQuickprof.h" #include "LinearMath/btQuickprof.h"
static const int kMaxConjugateGradientIterations = 200; static const int kMaxConjugateGradientIterations = 50;
btDeformableBodySolver::btDeformableBodySolver() btDeformableBodySolver::btDeformableBodySolver()
: m_numNodes(0) : m_numNodes(0)
, m_cg(kMaxConjugateGradientIterations) , m_cg(kMaxConjugateGradientIterations)

View File

@@ -175,7 +175,8 @@ public:
btSoftBody::Tetra& tetra = psb->m_tetras[j]; btSoftBody::Tetra& tetra = psb->m_tetras[j];
btMatrix3x3 P; btMatrix3x3 P;
firstPiola(psb->m_tetraScratches[j],P); firstPiola(psb->m_tetraScratches[j],P);
#if USE_SVD #define USE_SVD 1
#ifdef USE_SVD
if (max_p > 0) if (max_p > 0)
{ {
// since we want to clamp the principal stress to max_p, we only need to // since we want to clamp the principal stress to max_p, we only need to