diff options
Diffstat (limited to 'extern/bullet2/src/BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h')
-rw-r--r-- | extern/bullet2/src/BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/extern/bullet2/src/BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h b/extern/bullet2/src/BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h index 44fbfeadddc..d2ad54d21a8 100644 --- a/extern/bullet2/src/BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h +++ b/extern/bullet2/src/BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h @@ -20,11 +20,17 @@ subject to the following restrictions: #include "btMLCPSolverInterface.h" +///This solver is mainly for debug/learning purposes: it is functionally equivalent to the btSequentialImpulseConstraintSolver solver, but much slower (it builds the full LCP matrix) class btSolveProjectedGaussSeidel : public btMLCPSolverInterface { public: virtual bool solveMLCP(const btMatrixXu & A, const btVectorXu & b, btVectorXu& x, const btVectorXu & lo,const btVectorXu & hi,const btAlignedObjectArray<int>& limitDependency, int numIterations, bool useSparsity = true) { + if (!A.rows()) + return true; + //the A matrix is sparse, so compute the non-zero elements + A.rowComputeNonZeroElements(); + //A is a m-n matrix, m rows, n columns btAssert(A.rows() == b.rows()); |