diff --git a/src/BulletCollision/BroadphaseCollision/btDbvt.h b/src/BulletCollision/BroadphaseCollision/btDbvt.h index 51dbf3e58..324c499e2 100644 --- a/src/BulletCollision/BroadphaseCollision/btDbvt.h +++ b/src/BulletCollision/BroadphaseCollision/btDbvt.h @@ -21,7 +21,6 @@ subject to the following restrictions: #include "LinearMath/btVector3.h" #include "LinearMath/btTransform.h" #include "LinearMath/btAabbUtil2.h" -#include // // Compile time configuration // diff --git a/src/BulletSoftBody/btDeformableBodySolver.cpp b/src/BulletSoftBody/btDeformableBodySolver.cpp index 6395365fc..10d3775d3 100644 --- a/src/BulletSoftBody/btDeformableBodySolver.cpp +++ b/src/BulletSoftBody/btDeformableBodySolver.cpp @@ -149,7 +149,7 @@ void btDeformableBodySolver::updateEnergy(btScalar scale) } -btScalar btDeformableBodySolver::computeDescentStep(TVStack& ddv, const TVStack& residual) +btScalar btDeformableBodySolver::computeDescentStep(TVStack& ddv, const TVStack& residual, bool verbose) { m_cg.solve(*m_objective, ddv, residual, false); btScalar inner_product = m_cg.dot(residual, m_ddv); @@ -157,7 +157,10 @@ btScalar btDeformableBodySolver::computeDescentStep(TVStack& ddv, const TVStack& btScalar tol = 1e-5 * res_norm * m_objective->computeNorm(m_ddv); if (inner_product < -tol) { - std::cout << "Looking backwards!" << std::endl; + if (verbose) + { + std::cout << "Looking backwards!" << std::endl; + } for (int i = 0; i < m_ddv.size();++i) { m_ddv[i] = -m_ddv[i]; @@ -166,7 +169,10 @@ btScalar btDeformableBodySolver::computeDescentStep(TVStack& ddv, const TVStack& } else if (std::abs(inner_product) < tol) { - std::cout << "Gradient Descent!" << std::endl; + if (verbose) + { + std::cout << "Gradient Descent!" << std::endl; + } btScalar scale = m_objective->computeNorm(m_ddv) / res_norm; for (int i = 0; i < m_ddv.size();++i) { @@ -229,7 +235,7 @@ void btDeformableBodySolver::setConstraints() btScalar btDeformableBodySolver::solveContactConstraints() { - BT_PROFILE("setConstraint"); + BT_PROFILE("solveContactConstraints"); btScalar maxSquaredResidual = m_objective->m_projection.update(); return maxSquaredResidual; } diff --git a/src/BulletSoftBody/btDeformableBodySolver.h b/src/BulletSoftBody/btDeformableBodySolver.h index dc68157d5..bc56b3736 100644 --- a/src/BulletSoftBody/btDeformableBodySolver.h +++ b/src/BulletSoftBody/btDeformableBodySolver.h @@ -99,7 +99,7 @@ public: void computeStep(TVStack& ddv, const TVStack& residual); // calculate the change in dv resulting from the momentum solve when line search is turned on - btScalar computeDescentStep(TVStack& ddv, const TVStack& residual); + btScalar computeDescentStep(TVStack& ddv, const TVStack& residual, bool verbose=false); virtual void copySoftBodyToVertexBuffer(const btSoftBody *const softBody, btVertexBufferDescriptor *vertexBuffer) {}