Bullet Collision Detection & Physics Library: btMLCPSolver.h Source File

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
20 #include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
21 #include "LinearMath/btMatrixX.h"
22 #include "BulletDynamics/MLCPSolvers/btMLCPSolverInterface.h"
23
24 class btMLCPSolver : public btSequentialImpulseConstraintSolver
25 {
26
27 protected:
28
29 btMatrixXu m_A;
30 btVectorXu m_b;
31 btVectorXu m_x;
32 btVectorXu m_lo;
33 btVectorXu m_hi;
34
36 btVectorXu m_bSplit;
37 btVectorXu m_xSplit;
38 btVectorXu m_bSplit1;
39 btVectorXu m_xSplit2;
40
41 btAlignedObjectArray<int> m_limitDependencies;
42 btAlignedObjectArray<btSolverConstraint*> m_allConstraintPtrArray;
43 btMLCPSolverInterface* m_solver;
44 int m_fallback;
45 btScalar m_cfm;
46
47 virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
48 virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
49
50
51 virtual void createMLCP(const btContactSolverInfo& infoGlobal);
52 virtual void createMLCPFast(const btContactSolverInfo& infoGlobal);
53
54 //return true is it solves the problem successfully
55 virtual bool solveMLCP(const btContactSolverInfo& infoGlobal);
56
57 public:
58
59 btMLCPSolver( btMLCPSolverInterface* solver);
60 virtual ~btMLCPSolver();
61
62 void setMLCPSolver(btMLCPSolverInterface* solver)
63 {
64 m_solver = solver;
65 }
66
67 int getNumFallbacks() const
68 {
69 return m_fallback;
70 }
71 void setNumFallbacks(int num)
72 {
73 m_fallback = num;
74 }
75
76 btScalar getCfm() const
77 {
78 return m_cfm;
79 }
80 void setCfm(btScalar cfm)
81 {
82 m_cfm = cfm;
83 }
84
85 virtual btConstraintSolverType getSolverType() const
86 {
87 return BT_MLCP_SOLVER;
88 }
89
90 };
91
92
93 #endif //BT_MLCP_SOLVER_H
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition: btPersistentManifold.h:54
btMLCPSolver::getNumFallbacks
int getNumFallbacks() const
Definition: btMLCPSolver.h:67
btMLCPSolver::createMLCP
virtual void createMLCP(const btContactSolverInfo &infoGlobal)
Definition: btMLCPSolver.cpp:471
btAlignedObjectArray< int >
btMLCPSolverInterface.h
btMLCPSolver::m_fallback
int m_fallback
Definition: btMLCPSolver.h:44
btMLCPSolver::m_b
btVectorXu m_b
Definition: btMLCPSolver.h:30
btConstraintSolverType
btConstraintSolverType
btConstraintSolver provides solver interface
Definition: btConstraintSolver.h:33
btSequentialImpulseConstraintSolver.h
btMatrixXu
#define btMatrixXu
Definition: btMatrixX.h:548
btMLCPSolver::setCfm
void setCfm(btScalar cfm)
Definition: btMLCPSolver.h:80
btMatrixX.h
btMLCPSolver::m_A
btMatrixXu m_A
Definition: btMLCPSolver.h:29
btMLCPSolver::m_xSplit
btVectorXu m_xSplit
Definition: btMLCPSolver.h:37
btMLCPSolver::btMLCPSolver
btMLCPSolver(btMLCPSolverInterface *solver)
original version written by Erwin Coumans, October 2013
Definition: btMLCPSolver.cpp:23
btMLCPSolver::setNumFallbacks
void setNumFallbacks(int num)
Definition: btMLCPSolver.h:71
btMLCPSolver::getCfm
btScalar getCfm() const
Definition: btMLCPSolver.h:76
btMLCPSolver::~btMLCPSolver
virtual ~btMLCPSolver()
Definition: btMLCPSolver.cpp:30
btMLCPSolver::m_allConstraintPtrArray
btAlignedObjectArray< btSolverConstraint * > m_allConstraintPtrArray
Definition: btMLCPSolver.h:42
btMLCPSolverInterface
original version written by Erwin Coumans, October 2013
Definition: btMLCPSolverInterface.h:22
btVectorXu
#define btVectorXu
Definition: btMatrixX.h:547
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:49
btIDebugDraw
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations...
Definition: btIDebugDraw.h:29
btMLCPSolver::m_x
btVectorXu m_x
Definition: btMLCPSolver.h:31
btMLCPSolver::getSolverType
virtual btConstraintSolverType getSolverType() const
Definition: btMLCPSolver.h:85
btMLCPSolver::m_bSplit1
btVectorXu m_bSplit1
Definition: btMLCPSolver.h:38
btMLCPSolver::m_bSplit
btVectorXu m_bSplit
when using 'split impulse' we solve two separate (M)LCPs
Definition: btMLCPSolver.h:36
btMLCPSolver::solveGroupCacheFriendlyIterations
virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
Definition: btMLCPSolver.cpp:587
btSequentialImpulseConstraintSolver
The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (...
Definition: btSequentialImpulseConstraintSolver.h:33
btMLCPSolver::m_solver
btMLCPSolverInterface * m_solver
Definition: btMLCPSolver.h:43
btMLCPSolver::setMLCPSolver
void setMLCPSolver(btMLCPSolverInterface *solver)
Definition: btMLCPSolver.h:62
btMLCPSolver::m_xSplit2
btVectorXu m_xSplit2
Definition: btMLCPSolver.h:39
btMLCPSolver::solveGroupCacheFriendlySetup
virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
Definition: btMLCPSolver.cpp:37
btContactSolverInfo
Definition: btContactSolverInfo.h:65
BT_MLCP_SOLVER
Definition: btConstraintSolver.h:36
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:77
btMLCPSolver::solveMLCP
virtual bool solveMLCP(const btContactSolverInfo &infoGlobal)
Definition: btMLCPSolver.cpp:121
btMLCPSolver::m_limitDependencies
btAlignedObjectArray< int > m_limitDependencies
Definition: btMLCPSolver.h:41
btMLCPSolver::m_cfm
btScalar m_cfm
Definition: btMLCPSolver.h:45
btMLCPSolver::m_lo
btVectorXu m_lo
Definition: btMLCPSolver.h:32
btMLCPSolver::m_hi
btVectorXu m_hi
Definition: btMLCPSolver.h:33
btMLCPSolver
original version written by Erwin Coumans, October 2013
Definition: btMLCPSolver.h:24
btMLCPSolver::createMLCPFast
virtual void createMLCPFast(const btContactSolverInfo &infoGlobal)
Definition: btMLCPSolver.cpp:155
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:278