Bullet Collision Detection & Physics Library
btContactSolverInfo.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
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 */
15 
16 #ifndef BT_CONTACT_SOLVER_INFO
17 #define BT_CONTACT_SOLVER_INFO
18 
19 #include "LinearMath/btScalar.h"
20 
22 {
30  SOLVER_SIMD = 256,
33 };
34 
36 {
37 
38 
40  btScalar m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'.
46  btScalar m_sor;//successive over-relaxation term
47  btScalar m_erp;//error reduction for non-contact constraints
48  btScalar m_erp2;//error reduction for contact constraints
49  btScalar m_globalCfm;//constraint force mixing for contacts and non-contacts
50  btScalar m_frictionERP;//error reduction for friction constraints
51  btScalar m_frictionCFM;//constraint force mixing for friction constraints
52 
58 
66 
67 };
68 
70 {
71 
72 
73 
75  {
76  m_tau = btScalar(0.6);
77  m_damping = btScalar(1.0);
78  m_friction = btScalar(0.3);
79  m_timeStep = btScalar(1.f/60.f);
80  m_restitution = btScalar(0.);
82  m_numIterations = 10;
83  m_erp = btScalar(0.2);
84  m_erp2 = btScalar(0.2);
85  m_globalCfm = btScalar(0.);
86  m_frictionERP = btScalar(0.2);//positional friction 'anchors' are disabled by default
87  m_frictionCFM = btScalar(0.);
88  m_sor = btScalar(1.);
89  m_splitImpulse = true;
91  m_splitImpulseTurnErp = 0.1f;
92  m_linearSlop = btScalar(0.0);
94  //m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_SIMD | SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION|SOLVER_USE_2_FRICTION_DIRECTIONS|SOLVER_ENABLE_FRICTION_DIRECTION_CACHING;// | SOLVER_RANDMIZE_ORDER;
95  m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_SIMD;// | SOLVER_RANDMIZE_ORDER;
96  m_restingContactRestitutionThreshold = 2;//unused as of 2.81
97  m_minimumSolverBatchSize = 128; //try to combine islands until the amount of constraints reaches this limit
98  m_maxGyroscopicForce = 100.f;
101  m_restitutionVelocityThreshold = 0.2f;//if the relative velocity is below this threshold, there is zero restitution
102  }
103 };
104 
107 {
108  double m_tau;
109  double m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'.
110  double m_friction;
111  double m_timeStep;
114  double m_sor;
115  double m_erp;//used as Baumgarte factor
116  double m_erp2;//used in Split Impulse
117  double m_globalCfm;//constraint force mixing
120  double m_linearSlop;
124 
130  char m_padding[4];
131 
132 };
135 {
136  float m_tau;
137  float m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'.
138  float m_friction;
139  float m_timeStep;
140 
143  float m_sor;
144  float m_erp;//used as Baumgarte factor
145 
146  float m_erp2;//used in Split Impulse
147  float m_globalCfm;//constraint force mixing
150 
155 
160 
162  char m_padding[4];
163 };
164 
165 
166 
167 #endif //BT_CONTACT_SOLVER_INFO
btContactSolverInfoDoubleData::m_maxErrorReduction
double m_maxErrorReduction
Definition: btContactSolverInfo.h:113
btContactSolverInfoData::m_linearSlop
btScalar m_linearSlop
Definition: btContactSolverInfo.h:56
btContactSolverInfoData::m_restingContactRestitutionThreshold
int m_restingContactRestitutionThreshold
Definition: btContactSolverInfo.h:60
btContactSolverInfoFloatData::m_minimumSolverBatchSize
int m_minimumSolverBatchSize
Definition: btContactSolverInfo.h:159
btContactSolverInfoDoubleData::m_numIterations
int m_numIterations
Definition: btContactSolverInfo.h:125
SOLVER_SIMD
@ SOLVER_SIMD
Definition: btContactSolverInfo.h:30
btContactSolverInfoData::m_splitImpulsePenetrationThreshold
btScalar m_splitImpulsePenetrationThreshold
Definition: btContactSolverInfo.h:54
btContactSolverInfoDoubleData::m_solverMode
int m_solverMode
Definition: btContactSolverInfo.h:126
btContactSolverInfoFloatData::m_restitution
float m_restitution
Definition: btContactSolverInfo.h:141
btContactSolverInfoDoubleData::m_friction
double m_friction
Definition: btContactSolverInfo.h:110
btContactSolverInfo
Definition: btContactSolverInfo.h:69
btContactSolverInfoFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btContactSolverInfo.h:134
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:292
btContactSolverInfoData
Definition: btContactSolverInfo.h:35
btContactSolverInfoDoubleData::m_maxGyroscopicForce
double m_maxGyroscopicForce
Definition: btContactSolverInfo.h:122
btContactSolverInfoDoubleData::m_restitution
double m_restitution
Definition: btContactSolverInfo.h:112
SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION
@ SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION
Definition: btContactSolverInfo.h:28
btContactSolverInfoFloatData::m_restingContactRestitutionThreshold
int m_restingContactRestitutionThreshold
Definition: btContactSolverInfo.h:158
btContactSolverInfoDoubleData::m_singleAxisRollingFrictionThreshold
double m_singleAxisRollingFrictionThreshold
it is only used for 'explicit' version of gyroscopic force
Definition: btContactSolverInfo.h:123
btContactSolverInfoData::m_splitImpulseTurnErp
btScalar m_splitImpulseTurnErp
Definition: btContactSolverInfo.h:55
SOLVER_USE_WARMSTARTING
@ SOLVER_USE_WARMSTARTING
Definition: btContactSolverInfo.h:25
btContactSolverInfoFloatData::m_linearSlop
float m_linearSlop
Definition: btContactSolverInfo.h:151
btContactSolverInfoDoubleData::m_linearSlop
double m_linearSlop
Definition: btContactSolverInfo.h:120
btContactSolverInfoData::m_sor
btScalar m_sor
Definition: btContactSolverInfo.h:46
btContactSolverInfoData::m_damping
btScalar m_damping
Definition: btContactSolverInfo.h:40
btContactSolverInfoData::m_maxGyroscopicForce
btScalar m_maxGyroscopicForce
Definition: btContactSolverInfo.h:62
btContactSolverInfoFloatData::m_maxGyroscopicForce
float m_maxGyroscopicForce
Definition: btContactSolverInfo.h:153
btContactSolverInfoFloatData::m_erp
float m_erp
Definition: btContactSolverInfo.h:144
btContactSolverInfoData::m_warmstartingFactor
btScalar m_warmstartingFactor
Definition: btContactSolverInfo.h:57
btContactSolverInfoData::m_frictionERP
btScalar m_frictionERP
Definition: btContactSolverInfo.h:50
btContactSolverInfoDoubleData::m_minimumSolverBatchSize
int m_minimumSolverBatchSize
Definition: btContactSolverInfo.h:128
btSolverMode
btSolverMode
Definition: btContactSolverInfo.h:21
btScalar.h
btContactSolverInfoDoubleData::m_tau
double m_tau
Definition: btContactSolverInfo.h:108
btContactSolverInfoDoubleData::m_padding
char m_padding[4]
Definition: btContactSolverInfo.h:130
btContactSolverInfoDoubleData::m_splitImpulse
int m_splitImpulse
Definition: btContactSolverInfo.h:129
btContactSolverInfoFloatData::m_padding
char m_padding[4]
Definition: btContactSolverInfo.h:162
btContactSolverInfoFloatData::m_splitImpulseTurnErp
float m_splitImpulseTurnErp
Definition: btContactSolverInfo.h:149
btContactSolverInfoFloatData::m_tau
float m_tau
Definition: btContactSolverInfo.h:136
btContactSolverInfoFloatData::m_solverMode
int m_solverMode
Definition: btContactSolverInfo.h:157
btContactSolverInfoDoubleData::m_globalCfm
double m_globalCfm
Definition: btContactSolverInfo.h:117
btContactSolverInfoDoubleData::m_timeStep
double m_timeStep
Definition: btContactSolverInfo.h:111
btContactSolverInfoData::m_maxErrorReduction
btScalar m_maxErrorReduction
Definition: btContactSolverInfo.h:45
btContactSolverInfoData::m_timeStep
btScalar m_timeStep
Definition: btContactSolverInfo.h:42
btContactSolverInfoFloatData::m_numIterations
int m_numIterations
Definition: btContactSolverInfo.h:156
btContactSolverInfoData::m_singleAxisRollingFrictionThreshold
btScalar m_singleAxisRollingFrictionThreshold
Definition: btContactSolverInfo.h:63
btContactSolverInfoData::m_frictionCFM
btScalar m_frictionCFM
Definition: btContactSolverInfo.h:51
SOLVER_CACHE_FRIENDLY
@ SOLVER_CACHE_FRIENDLY
Definition: btContactSolverInfo.h:29
btContactSolverInfoDoubleData::m_erp2
double m_erp2
Definition: btContactSolverInfo.h:116
btContactSolverInfoFloatData::m_maxErrorReduction
float m_maxErrorReduction
Definition: btContactSolverInfo.h:142
btContactSolverInfoFloatData::m_damping
float m_damping
Definition: btContactSolverInfo.h:137
btContactSolverInfoDoubleData::m_damping
double m_damping
Definition: btContactSolverInfo.h:109
btContactSolverInfoFloatData::m_globalCfm
float m_globalCfm
Definition: btContactSolverInfo.h:147
btContactSolverInfoFloatData::m_splitImpulsePenetrationThreshold
float m_splitImpulsePenetrationThreshold
Definition: btContactSolverInfo.h:148
btContactSolverInfoDoubleData::m_sor
double m_sor
Definition: btContactSolverInfo.h:114
btContactSolverInfoFloatData::m_erp2
float m_erp2
Definition: btContactSolverInfo.h:146
btContactSolverInfoData::m_splitImpulse
int m_splitImpulse
Definition: btContactSolverInfo.h:53
btContactSolverInfoData::m_globalCfm
btScalar m_globalCfm
Definition: btContactSolverInfo.h:49
btContactSolverInfoData::m_solverMode
int m_solverMode
Definition: btContactSolverInfo.h:59
SOLVER_ALLOW_ZERO_LENGTH_FRICTION_DIRECTIONS
@ SOLVER_ALLOW_ZERO_LENGTH_FRICTION_DIRECTIONS
Definition: btContactSolverInfo.h:32
btContactSolverInfoFloatData::m_timeStep
float m_timeStep
Definition: btContactSolverInfo.h:139
btContactSolverInfoData::m_leastSquaresResidualThreshold
btScalar m_leastSquaresResidualThreshold
Definition: btContactSolverInfo.h:64
btContactSolverInfoFloatData::m_sor
float m_sor
Definition: btContactSolverInfo.h:143
btContactSolverInfoData::m_restitution
btScalar m_restitution
Definition: btContactSolverInfo.h:43
btContactSolverInfoDoubleData::m_splitImpulsePenetrationThreshold
double m_splitImpulsePenetrationThreshold
Definition: btContactSolverInfo.h:118
btContactSolverInfoData::m_erp
btScalar m_erp
Definition: btContactSolverInfo.h:47
btContactSolverInfoData::m_friction
btScalar m_friction
Definition: btContactSolverInfo.h:41
btContactSolverInfoDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btContactSolverInfo.h:106
btContactSolverInfoDoubleData::m_warmstartingFactor
double m_warmstartingFactor
Definition: btContactSolverInfo.h:121
SOLVER_FRICTION_SEPARATE
@ SOLVER_FRICTION_SEPARATE
Definition: btContactSolverInfo.h:24
btContactSolverInfoData::m_restitutionVelocityThreshold
btScalar m_restitutionVelocityThreshold
Definition: btContactSolverInfo.h:65
SOLVER_ENABLE_FRICTION_DIRECTION_CACHING
@ SOLVER_ENABLE_FRICTION_DIRECTION_CACHING
Definition: btContactSolverInfo.h:27
btContactSolverInfoFloatData::m_singleAxisRollingFrictionThreshold
float m_singleAxisRollingFrictionThreshold
Definition: btContactSolverInfo.h:154
btContactSolverInfo::btContactSolverInfo
btContactSolverInfo()
Definition: btContactSolverInfo.h:74
btContactSolverInfoDoubleData::m_splitImpulseTurnErp
double m_splitImpulseTurnErp
Definition: btContactSolverInfo.h:119
btContactSolverInfoFloatData::m_friction
float m_friction
Definition: btContactSolverInfo.h:138
SOLVER_USE_2_FRICTION_DIRECTIONS
@ SOLVER_USE_2_FRICTION_DIRECTIONS
Definition: btContactSolverInfo.h:26
btContactSolverInfoDoubleData::m_erp
double m_erp
Definition: btContactSolverInfo.h:115
btContactSolverInfoDoubleData::m_restingContactRestitutionThreshold
int m_restingContactRestitutionThreshold
Definition: btContactSolverInfo.h:127
SOLVER_INTERLEAVE_CONTACT_AND_FRICTION_CONSTRAINTS
@ SOLVER_INTERLEAVE_CONTACT_AND_FRICTION_CONSTRAINTS
Definition: btContactSolverInfo.h:31
btContactSolverInfoData::m_tau
btScalar m_tau
Definition: btContactSolverInfo.h:39
btContactSolverInfoData::m_minimumSolverBatchSize
int m_minimumSolverBatchSize
Definition: btContactSolverInfo.h:61
btContactSolverInfoData::m_numIterations
int m_numIterations
Definition: btContactSolverInfo.h:44
SOLVER_RANDMIZE_ORDER
@ SOLVER_RANDMIZE_ORDER
Definition: btContactSolverInfo.h:23
btContactSolverInfoFloatData::m_warmstartingFactor
float m_warmstartingFactor
Definition: btContactSolverInfo.h:152
btContactSolverInfoData::m_erp2
btScalar m_erp2
Definition: btContactSolverInfo.h:48
btContactSolverInfoFloatData::m_splitImpulse
int m_splitImpulse
Definition: btContactSolverInfo.h:161