Bullet Collision Detection & Physics Library
btMLCPSolver.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2013 Erwin Coumans http://bulletphysics.org
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
16 
17 #ifndef BT_MLCP_SOLVER_H
18 #define BT_MLCP_SOLVER_H
19 
21 #include "LinearMath/btMatrixX.h"
23 
25 {
26 
27 protected:
28 
34 
40 
45 
46  virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
47  virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
48  virtual void createMLCP(const btContactSolverInfo& infoGlobal);
49  virtual void createMLCPFast(const btContactSolverInfo& infoGlobal);
50 
51  //return true is it solves the problem successfully
52  virtual bool solveMLCP(const btContactSolverInfo& infoGlobal);
53 
54 public:
55 
57  virtual ~btMLCPSolver();
58 
60  {
61  m_solver = solver;
62  }
63 
64  int getNumFallbacks() const
65  {
66  return m_fallback;
67  }
68  void setNumFallbacks(int num)
69  {
70  m_fallback = num;
71  }
72 
74  {
75  return BT_MLCP_SOLVER;
76  }
77 
78 };
79 
80 
81 #endif //BT_MLCP_SOLVER_H
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
int getNumFallbacks() const
Definition: btMLCPSolver.h:64
virtual void createMLCP(const btContactSolverInfo &infoGlobal)
btVectorXu m_b
Definition: btMLCPSolver.h:30
btConstraintSolverType
btConstraintSolver provides solver interface
#define btMatrixXu
Definition: btMatrixX.h:499
btConstraintArray m_allConstraintArray
Definition: btMLCPSolver.h:42
btMatrixXu m_A
Definition: btMLCPSolver.h:29
btVectorXu m_xSplit
Definition: btMLCPSolver.h:37
btMLCPSolver(btMLCPSolverInterface *solver)
original version written by Erwin Coumans, October 2013
void setNumFallbacks(int num)
Definition: btMLCPSolver.h:68
virtual ~btMLCPSolver()
original version written by Erwin Coumans, October 2013
#define btVectorXu
Definition: btMatrixX.h:498
btCollisionObject can be used to manage collision detection objects.
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations...
Definition: btIDebugDraw.h:28
btVectorXu m_x
Definition: btMLCPSolver.h:31
virtual btConstraintSolverType getSolverType() const
Definition: btMLCPSolver.h:73
btVectorXu m_bSplit1
Definition: btMLCPSolver.h:38
btVectorXu m_bSplit
when using 'split impulse' we solve two separate (M)LCPs
Definition: btMLCPSolver.h:36
virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (...
btMLCPSolverInterface * m_solver
Definition: btMLCPSolver.h:43
void setMLCPSolver(btMLCPSolverInterface *solver)
Definition: btMLCPSolver.h:59
btVectorXu m_xSplit2
Definition: btMLCPSolver.h:39
virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
TypedConstraint is the baseclass for Bullet constraints and vehicles.
virtual bool solveMLCP(const btContactSolverInfo &infoGlobal)
btAlignedObjectArray< int > m_limitDependencies
Definition: btMLCPSolver.h:41
btVectorXu m_lo
Definition: btMLCPSolver.h:32
btVectorXu m_hi
Definition: btMLCPSolver.h:33
original version written by Erwin Coumans, October 2013
Definition: btMLCPSolver.h:24
virtual void createMLCPFast(const btContactSolverInfo &infoGlobal)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:266