Bullet Collision Detection & Physics Library: btNNCGConstraintSolver.cpp Source File

Bullet Collision Detection & Physics Library

btNNCGConstraintSolver.cpp
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 #include "btNNCGConstraintSolver.h"
17
18
19
20
21
22
23 btScalar btNNCGConstraintSolver::solveGroupCacheFriendlySetup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer)
24 {
25 btScalar val = btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup( bodies,numBodies,manifoldPtr, numManifolds, constraints,numConstraints,infoGlobal,debugDrawer);
26
27 m_pNC.resizeNoInitialize(m_tmpSolverNonContactConstraintPool.size());
28 m_pC.resizeNoInitialize(m_tmpSolverContactConstraintPool.size());
29 m_pCF.resizeNoInitialize(m_tmpSolverContactFrictionConstraintPool.size());
30 m_pCRF.resizeNoInitialize(m_tmpSolverContactRollingFrictionConstraintPool.size());
31
32 m_deltafNC.resizeNoInitialize(m_tmpSolverNonContactConstraintPool.size());
33 m_deltafC.resizeNoInitialize(m_tmpSolverContactConstraintPool.size());
34 m_deltafCF.resizeNoInitialize(m_tmpSolverContactFrictionConstraintPool.size());
35 m_deltafCRF.resizeNoInitialize(m_tmpSolverContactRollingFrictionConstraintPool.size());
36
37 return val;
38 }
39
40 btScalar btNNCGConstraintSolver::solveSingleIteration(int iteration, btCollisionObject** /*bodies */,int /*numBodies*/,btPersistentManifold** /*manifoldPtr*/, int /*numManifolds*/,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* /*debugDrawer*/)
41 {
42
43 int numNonContactPool = m_tmpSolverNonContactConstraintPool.size();
44 int numConstraintPool = m_tmpSolverContactConstraintPool.size();
45 int numFrictionPool = m_tmpSolverContactFrictionConstraintPool.size();
46
47 if (infoGlobal.m_solverMode & SOLVER_RANDMIZE_ORDER)
48 {
49 if (1) // uncomment this for a bit less random ((iteration & 7) == 0)
50 {
51
52 for (int j=0; j<numNonContactPool; ++j) {
53 int tmp = m_orderNonContactConstraintPool[j];
54 int swapi = btRandInt2(j+1);
55 m_orderNonContactConstraintPool[j] = m_orderNonContactConstraintPool[swapi];
56 m_orderNonContactConstraintPool[swapi] = tmp;
57 }
58
59 //contact/friction constraints are not solved more than
60 if (iteration< infoGlobal.m_numIterations)
61 {
62 for (int j=0; j<numConstraintPool; ++j) {
63 int tmp = m_orderTmpConstraintPool[j];
64 int swapi = btRandInt2(j+1);
65 m_orderTmpConstraintPool[j] = m_orderTmpConstraintPool[swapi];
66 m_orderTmpConstraintPool[swapi] = tmp;
67 }
68
69 for (int j=0; j<numFrictionPool; ++j) {
70 int tmp = m_orderFrictionConstraintPool[j];
71 int swapi = btRandInt2(j+1);
72 m_orderFrictionConstraintPool[j] = m_orderFrictionConstraintPool[swapi];
73 m_orderFrictionConstraintPool[swapi] = tmp;
74 }
75 }
76 }
77 }
78
79
80 btScalar deltaflengthsqr = 0;
81 {
82 for (int j=0;j<m_tmpSolverNonContactConstraintPool.size();j++)
83 {
84 btSolverConstraint& constraint = m_tmpSolverNonContactConstraintPool[m_orderNonContactConstraintPool[j]];
85 if (iteration < constraint.m_overrideNumSolverIterations)
86 {
87 btScalar deltaf = resolveSingleConstraintRowGeneric(m_tmpSolverBodyPool[constraint.m_solverBodyIdA],m_tmpSolverBodyPool[constraint.m_solverBodyIdB],constraint);
88 m_deltafNC[j] = deltaf;
89 deltaflengthsqr += deltaf * deltaf;
90 }
91 }
92 }
93
94
95 if (m_onlyForNoneContact)
96 {
97 if (iteration==0)
98 {
99 for (int j=0;j<m_tmpSolverNonContactConstraintPool.size();j++) m_pNC[j] = m_deltafNC[j];
100 } else {
101 // deltaflengthsqrprev can be 0 only if the solver solved the problem exactly in the previous iteration. In this case we should have quit, but mainly for debug reason with this 'hack' it is now allowed to continue the calculation
102 btScalar beta = m_deltafLengthSqrPrev>0 ? deltaflengthsqr / m_deltafLengthSqrPrev : 2;
103 if (beta>1)
104 {
105 for (int j=0;j<m_tmpSolverNonContactConstraintPool.size();j++) m_pNC[j] = 0;
106 } else
107 {
108 for (int j=0;j<m_tmpSolverNonContactConstraintPool.size();j++)
109 {
110 btSolverConstraint& constraint = m_tmpSolverNonContactConstraintPool[m_orderNonContactConstraintPool[j]];
111 if (iteration < constraint.m_overrideNumSolverIterations)
112 {
113 btScalar additionaldeltaimpulse = beta * m_pNC[j];
114 constraint.m_appliedImpulse = btScalar(constraint.m_appliedImpulse) + additionaldeltaimpulse;
115 m_pNC[j] = beta * m_pNC[j] + m_deltafNC[j];
116 btSolverBody& body1 = m_tmpSolverBodyPool[constraint.m_solverBodyIdA];
117 btSolverBody& body2 = m_tmpSolverBodyPool[constraint.m_solverBodyIdB];
118 const btSolverConstraint& c = constraint;
119 body1.internalApplyImpulse(c.m_contactNormal1*body1.internalGetInvMass(),c.m_angularComponentA,additionaldeltaimpulse);
120 body2.internalApplyImpulse(c.m_contactNormal2*body2.internalGetInvMass(),c.m_angularComponentB,additionaldeltaimpulse);
121 }
122 }
123 }
124 }
125 m_deltafLengthSqrPrev = deltaflengthsqr;
126 }
127
128
129
130 {
131
132 if (iteration< infoGlobal.m_numIterations)
133 {
134 for (int j=0;j<numConstraints;j++)
135 {
136 if (constraints[j]->isEnabled())
137 {
138 int bodyAid = getOrInitSolverBody(constraints[j]->getRigidBodyA(),infoGlobal.m_timeStep);
139 int bodyBid = getOrInitSolverBody(constraints[j]->getRigidBodyB(),infoGlobal.m_timeStep);
140 btSolverBody& bodyA = m_tmpSolverBodyPool[bodyAid];
141 btSolverBody& bodyB = m_tmpSolverBodyPool[bodyBid];
142 constraints[j]->solveConstraintObsolete(bodyA,bodyB,infoGlobal.m_timeStep);
143 }
144 }
145
147 if (infoGlobal.m_solverMode & SOLVER_INTERLEAVE_CONTACT_AND_FRICTION_CONSTRAINTS)
148 {
149 int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
150 int multiplier = (infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS)? 2 : 1;
151
152 for (int c=0;c<numPoolConstraints;c++)
153 {
154 btScalar totalImpulse =0;
155
156 {
157 const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[c]];
158 btScalar deltaf = resolveSingleConstraintRowLowerLimit(m_tmpSolverBodyPool[solveManifold.m_solverBodyIdA],m_tmpSolverBodyPool[solveManifold.m_solverBodyIdB],solveManifold);
159 m_deltafC[c] = deltaf;
160 deltaflengthsqr += deltaf*deltaf;
161 totalImpulse = solveManifold.m_appliedImpulse;
162 }
163 bool applyFriction = true;
164 if (applyFriction)
165 {
166 {
167
168 btSolverConstraint& solveManifold = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[c*multiplier]];
169
170 if (totalImpulse>btScalar(0))
171 {
172 solveManifold.m_lowerLimit = -(solveManifold.m_friction*totalImpulse);
173 solveManifold.m_upperLimit = solveManifold.m_friction*totalImpulse;
174 btScalar deltaf = resolveSingleConstraintRowGeneric(m_tmpSolverBodyPool[solveManifold.m_solverBodyIdA],m_tmpSolverBodyPool[solveManifold.m_solverBodyIdB],solveManifold);
175 m_deltafCF[c*multiplier] = deltaf;
176 deltaflengthsqr += deltaf*deltaf;
177 } else {
178 m_deltafCF[c*multiplier] = 0;
179 }
180 }
181
182 if (infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS)
183 {
184
185 btSolverConstraint& solveManifold = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[c*multiplier+1]];
186
187 if (totalImpulse>btScalar(0))
188 {
189 solveManifold.m_lowerLimit = -(solveManifold.m_friction*totalImpulse);
190 solveManifold.m_upperLimit = solveManifold.m_friction*totalImpulse;
191 btScalar deltaf = resolveSingleConstraintRowGeneric(m_tmpSolverBodyPool[solveManifold.m_solverBodyIdA],m_tmpSolverBodyPool[solveManifold.m_solverBodyIdB],solveManifold);
192 m_deltafCF[c*multiplier+1] = deltaf;
193 deltaflengthsqr += deltaf*deltaf;
194 } else {
195 m_deltafCF[c*multiplier+1] = 0;
196 }
197 }
198 }
199 }
200
201 }
202 else//SOLVER_INTERLEAVE_CONTACT_AND_FRICTION_CONSTRAINTS
203 {
204 //solve the friction constraints after all contact constraints, don't interleave them
205 int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
206 int j;
207
208 for (j=0;j<numPoolConstraints;j++)
209 {
210 const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
211 btScalar deltaf = resolveSingleConstraintRowLowerLimit(m_tmpSolverBodyPool[solveManifold.m_solverBodyIdA],m_tmpSolverBodyPool[solveManifold.m_solverBodyIdB],solveManifold);
212 m_deltafC[j] = deltaf;
213 deltaflengthsqr += deltaf*deltaf;
214 }
215
216
217
219
220 int numFrictionPoolConstraints = m_tmpSolverContactFrictionConstraintPool.size();
221 for (j=0;j<numFrictionPoolConstraints;j++)
222 {
223 btSolverConstraint& solveManifold = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[j]];
224 btScalar totalImpulse = m_tmpSolverContactConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse;
225
226 if (totalImpulse>btScalar(0))
227 {
228 solveManifold.m_lowerLimit = -(solveManifold.m_friction*totalImpulse);
229 solveManifold.m_upperLimit = solveManifold.m_friction*totalImpulse;
230
231 btScalar deltaf = resolveSingleConstraintRowGeneric(m_tmpSolverBodyPool[solveManifold.m_solverBodyIdA],m_tmpSolverBodyPool[solveManifold.m_solverBodyIdB],solveManifold);
232 m_deltafCF[j] = deltaf;
233 deltaflengthsqr += deltaf*deltaf;
234 } else {
235 m_deltafCF[j] = 0;
236 }
237 }
238 }
239
240 {
241 int numRollingFrictionPoolConstraints = m_tmpSolverContactRollingFrictionConstraintPool.size();
242 for (int j=0;j<numRollingFrictionPoolConstraints;j++)
243 {
244
245 btSolverConstraint& rollingFrictionConstraint = m_tmpSolverContactRollingFrictionConstraintPool[j];
246 btScalar totalImpulse = m_tmpSolverContactConstraintPool[rollingFrictionConstraint.m_frictionIndex].m_appliedImpulse;
247 if (totalImpulse>btScalar(0))
248 {
249 btScalar rollingFrictionMagnitude = rollingFrictionConstraint.m_friction*totalImpulse;
250 if (rollingFrictionMagnitude>rollingFrictionConstraint.m_friction)
251 rollingFrictionMagnitude = rollingFrictionConstraint.m_friction;
252
253 rollingFrictionConstraint.m_lowerLimit = -rollingFrictionMagnitude;
254 rollingFrictionConstraint.m_upperLimit = rollingFrictionMagnitude;
255
256 btScalar deltaf = resolveSingleConstraintRowGeneric(m_tmpSolverBodyPool[rollingFrictionConstraint.m_solverBodyIdA],m_tmpSolverBodyPool[rollingFrictionConstraint.m_solverBodyIdB],rollingFrictionConstraint);
257 m_deltafCRF[j] = deltaf;
258 deltaflengthsqr += deltaf*deltaf;
259 } else {
260 m_deltafCRF[j] = 0;
261 }
262 }
263 }
264
265 }
266
267
268
269 }
270
271
272
273
274 if (!m_onlyForNoneContact)
275 {
276 if (iteration==0)
277 {
278 for (int j=0;j<m_tmpSolverNonContactConstraintPool.size();j++) m_pNC[j] = m_deltafNC[j];
279 for (int j=0;j<m_tmpSolverContactConstraintPool.size();j++) m_pC[j] = m_deltafC[j];
280 for (int j=0;j<m_tmpSolverContactFrictionConstraintPool.size();j++) m_pCF[j] = m_deltafCF[j];
281 for (int j=0;j<m_tmpSolverContactRollingFrictionConstraintPool.size();j++) m_pCRF[j] = m_deltafCRF[j];
282 } else
283 {
284 // deltaflengthsqrprev can be 0 only if the solver solved the problem exactly in the previous iteration. In this case we should have quit, but mainly for debug reason with this 'hack' it is now allowed to continue the calculation
285 btScalar beta = m_deltafLengthSqrPrev>0 ? deltaflengthsqr / m_deltafLengthSqrPrev : 2;
286 if (beta>1) {
287 for (int j=0;j<m_tmpSolverNonContactConstraintPool.size();j++) m_pNC[j] = 0;
288 for (int j=0;j<m_tmpSolverContactConstraintPool.size();j++) m_pC[j] = 0;
289 for (int j=0;j<m_tmpSolverContactFrictionConstraintPool.size();j++) m_pCF[j] = 0;
290 for (int j=0;j<m_tmpSolverContactRollingFrictionConstraintPool.size();j++) m_pCRF[j] = 0;
291 } else {
292 for (int j=0;j<m_tmpSolverNonContactConstraintPool.size();j++)
293 {
294 btSolverConstraint& constraint = m_tmpSolverNonContactConstraintPool[m_orderNonContactConstraintPool[j]];
295 if (iteration < constraint.m_overrideNumSolverIterations) {
296 btScalar additionaldeltaimpulse = beta * m_pNC[j];
297 constraint.m_appliedImpulse = btScalar(constraint.m_appliedImpulse) + additionaldeltaimpulse;
298 m_pNC[j] = beta * m_pNC[j] + m_deltafNC[j];
299 btSolverBody& body1 = m_tmpSolverBodyPool[constraint.m_solverBodyIdA];
300 btSolverBody& body2 = m_tmpSolverBodyPool[constraint.m_solverBodyIdB];
301 const btSolverConstraint& c = constraint;
302 body1.internalApplyImpulse(c.m_contactNormal1*body1.internalGetInvMass(),c.m_angularComponentA,additionaldeltaimpulse);
303 body2.internalApplyImpulse(c.m_contactNormal2*body2.internalGetInvMass(),c.m_angularComponentB,additionaldeltaimpulse);
304 }
305 }
306 for (int j=0;j<m_tmpSolverContactConstraintPool.size();j++)
307 {
308 btSolverConstraint& constraint = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
309 if (iteration< infoGlobal.m_numIterations) {
310 btScalar additionaldeltaimpulse = beta * m_pC[j];
311 constraint.m_appliedImpulse = btScalar(constraint.m_appliedImpulse) + additionaldeltaimpulse;
312 m_pC[j] = beta * m_pC[j] + m_deltafC[j];
313 btSolverBody& body1 = m_tmpSolverBodyPool[constraint.m_solverBodyIdA];
314 btSolverBody& body2 = m_tmpSolverBodyPool[constraint.m_solverBodyIdB];
315 const btSolverConstraint& c = constraint;
316 body1.internalApplyImpulse(c.m_contactNormal1*body1.internalGetInvMass(),c.m_angularComponentA,additionaldeltaimpulse);
317 body2.internalApplyImpulse(c.m_contactNormal2*body2.internalGetInvMass(),c.m_angularComponentB,additionaldeltaimpulse);
318 }
319 }
320 for (int j=0;j<m_tmpSolverContactFrictionConstraintPool.size();j++)
321 {
322 btSolverConstraint& constraint = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[j]];
323 if (iteration< infoGlobal.m_numIterations) {
324 btScalar additionaldeltaimpulse = beta * m_pCF[j];
325 constraint.m_appliedImpulse = btScalar(constraint.m_appliedImpulse) + additionaldeltaimpulse;
326 m_pCF[j] = beta * m_pCF[j] + m_deltafCF[j];
327 btSolverBody& body1 = m_tmpSolverBodyPool[constraint.m_solverBodyIdA];
328 btSolverBody& body2 = m_tmpSolverBodyPool[constraint.m_solverBodyIdB];
329 const btSolverConstraint& c = constraint;
330 body1.internalApplyImpulse(c.m_contactNormal1*body1.internalGetInvMass(),c.m_angularComponentA,additionaldeltaimpulse);
331 body2.internalApplyImpulse(c.m_contactNormal2*body2.internalGetInvMass(),c.m_angularComponentB,additionaldeltaimpulse);
332 }
333 }
334 {
335 for (int j=0;j<m_tmpSolverContactRollingFrictionConstraintPool.size();j++)
336 {
337 btSolverConstraint& constraint = m_tmpSolverContactRollingFrictionConstraintPool[j];
338 if (iteration< infoGlobal.m_numIterations) {
339 btScalar additionaldeltaimpulse = beta * m_pCRF[j];
340 constraint.m_appliedImpulse = btScalar(constraint.m_appliedImpulse) + additionaldeltaimpulse;
341 m_pCRF[j] = beta * m_pCRF[j] + m_deltafCRF[j];
342 btSolverBody& body1 = m_tmpSolverBodyPool[constraint.m_solverBodyIdA];
343 btSolverBody& body2 = m_tmpSolverBodyPool[constraint.m_solverBodyIdB];
344 const btSolverConstraint& c = constraint;
345 body1.internalApplyImpulse(c.m_contactNormal1*body1.internalGetInvMass(),c.m_angularComponentA,additionaldeltaimpulse);
346 body2.internalApplyImpulse(c.m_contactNormal2*body2.internalGetInvMass(),c.m_angularComponentB,additionaldeltaimpulse);
347 }
348 }
349 }
350 }
351 }
352 m_deltafLengthSqrPrev = deltaflengthsqr;
353 }
354
355 return deltaflengthsqr;
356 }
357
358 btScalar btNNCGConstraintSolver::solveGroupCacheFriendlyFinish(btCollisionObject** bodies,int numBodies,const btContactSolverInfo& infoGlobal)
359 {
360 m_pNC.resizeNoInitialize(0);
361 m_pC.resizeNoInitialize(0);
362 m_pCF.resizeNoInitialize(0);
363 m_pCRF.resizeNoInitialize(0);
364
365 m_deltafNC.resizeNoInitialize(0);
366 m_deltafC.resizeNoInitialize(0);
367 m_deltafCF.resizeNoInitialize(0);
368 m_deltafCRF.resizeNoInitialize(0);
369
370 return btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyFinish(bodies, numBodies, infoGlobal);
371 }
372
373
374
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition: btPersistentManifold.h:63
btSolverConstraint::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btSolverConstraint.h:61
btSequentialImpulseConstraintSolver::m_tmpSolverContactFrictionConstraintPool
btConstraintArray m_tmpSolverContactFrictionConstraintPool
Definition: btSequentialImpulseConstraintSolver.h:39
btSequentialImpulseConstraintSolver::m_tmpSolverContactRollingFrictionConstraintPool
btConstraintArray m_tmpSolverContactRollingFrictionConstraintPool
Definition: btSequentialImpulseConstraintSolver.h:40
btSolverBody::internalApplyImpulse
void internalApplyImpulse(const btVector3 &linearComponent, const btVector3 &angularComponent, const btScalar impulseMagnitude)
Definition: btSolverBody.h:255
btSolverConstraint::m_friction
btScalar m_friction
Definition: btSolverConstraint.h:46
btNNCGConstraintSolver::m_pCRF
btAlignedObjectArray< btScalar > m_pCRF
Definition: btNNCGConstraintSolver.h:30
btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyFinish
virtual btScalar solveGroupCacheFriendlyFinish(btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal)
Definition: btSequentialImpulseConstraintSolver.cpp:1869
btNNCGConstraintSolver.h
btSolverConstraint
1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and fr...
Definition: btSolverConstraint.h:30
btAlignedObjectArray::resizeNoInitialize
void resizeNoInitialize(int newsize)
resize changes the number of elements in the array.
Definition: btAlignedObjectArray.h:209
btNNCGConstraintSolver::solveGroupCacheFriendlyFinish
virtual btScalar solveGroupCacheFriendlyFinish(btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal)
Definition: btNNCGConstraintSolver.cpp:358
btSolverBody::internalGetInvMass
const btVector3 & internalGetInvMass() const
Definition: btSolverBody.h:223
btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimit
btSimdScalar resolveSingleConstraintRowLowerLimit(btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
Definition: btSequentialImpulseConstraintSolver.cpp:287
btNNCGConstraintSolver::m_pNC
btAlignedObjectArray< btScalar > m_pNC
Definition: btNNCGConstraintSolver.h:27
btSequentialImpulseConstraintSolver::m_orderTmpConstraintPool
btAlignedObjectArray< int > m_orderTmpConstraintPool
Definition: btSequentialImpulseConstraintSolver.h:42
btNNCGConstraintSolver::m_deltafLengthSqrPrev
btScalar m_deltafLengthSqrPrev
Definition: btNNCGConstraintSolver.h:25
btNNCGConstraintSolver::m_onlyForNoneContact
bool m_onlyForNoneContact
Definition: btNNCGConstraintSolver.h:57
btSequentialImpulseConstraintSolver::getOrInitSolverBody
int getOrInitSolverBody(btCollisionObject &body, btScalar timeStep)
Definition: btSequentialImpulseConstraintSolver.cpp:737
btSolverConstraint::m_angularComponentA
btVector3 m_angularComponentA
Definition: btSolverConstraint.h:40
btSequentialImpulseConstraintSolver::m_tmpSolverBodyPool
btAlignedObjectArray< btSolverBody > m_tmpSolverBodyPool
Definition: btSequentialImpulseConstraintSolver.h:36
btNNCGConstraintSolver::m_deltafCRF
btAlignedObjectArray< btScalar > m_deltafCRF
Definition: btNNCGConstraintSolver.h:36
btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric
btSimdScalar resolveSingleConstraintRowGeneric(btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
Definition: btSequentialImpulseConstraintSolver.cpp:276
btSequentialImpulseConstraintSolver::btRandInt2
int btRandInt2(int n)
Definition: btSequentialImpulseConstraintSolver.cpp:439
SOLVER_RANDMIZE_ORDER
Definition: btContactSolverInfo.h:23
btSequentialImpulseConstraintSolver::m_tmpSolverContactConstraintPool
btConstraintArray m_tmpSolverContactConstraintPool
Definition: btSequentialImpulseConstraintSolver.h:37
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:49
btNNCGConstraintSolver::m_deltafC
btAlignedObjectArray< btScalar > m_deltafC
Definition: btNNCGConstraintSolver.h:34
btIDebugDraw
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations...
Definition: btIDebugDraw.h:29
btSolverConstraint::m_angularComponentB
btVector3 m_angularComponentB
Definition: btSolverConstraint.h:41
btSolverConstraint::m_solverBodyIdB
int m_solverBodyIdB
Definition: btSolverConstraint.h:64
SOLVER_USE_2_FRICTION_DIRECTIONS
Definition: btContactSolverInfo.h:26
btSolverConstraint::m_upperLimit
btScalar m_upperLimit
Definition: btSolverConstraint.h:52
btContactSolverInfoData::m_numIterations
int m_numIterations
Definition: btContactSolverInfo.h:44
SOLVER_INTERLEAVE_CONTACT_AND_FRICTION_CONSTRAINTS
Definition: btContactSolverInfo.h:31
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:155
btTypedConstraint::solveConstraintObsolete
virtual void solveConstraintObsolete(btSolverBody &, btSolverBody &, btScalar)
internal method used by the constraint solver, don&#39;t use them directly
Definition: btTypedConstraint.h:219
btContactSolverInfo
Definition: btContactSolverInfo.h:69
btSolverBody
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
Definition: btSolverBody.h:108
btNNCGConstraintSolver::solveSingleIteration
virtual btScalar solveSingleIteration(int iteration, btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
Definition: btNNCGConstraintSolver.cpp:40
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:78
btSolverConstraint::m_solverBodyIdA
int m_solverBodyIdA
Definition: btSolverConstraint.h:63
btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup
virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
Definition: btSequentialImpulseConstraintSolver.cpp:1261
btNNCGConstraintSolver::m_deltafCF
btAlignedObjectArray< btScalar > m_deltafCF
Definition: btNNCGConstraintSolver.h:35
btNNCGConstraintSolver::m_deltafNC
btAlignedObjectArray< btScalar > m_deltafNC
Definition: btNNCGConstraintSolver.h:33
btSolverConstraint::m_contactNormal1
btVector3 m_contactNormal1
Definition: btSolverConstraint.h:35
btSequentialImpulseConstraintSolver::m_orderFrictionConstraintPool
btAlignedObjectArray< int > m_orderFrictionConstraintPool
Definition: btSequentialImpulseConstraintSolver.h:44
btNNCGConstraintSolver::m_pC
btAlignedObjectArray< btScalar > m_pC
Definition: btNNCGConstraintSolver.h:28
btSequentialImpulseConstraintSolver::m_orderNonContactConstraintPool
btAlignedObjectArray< int > m_orderNonContactConstraintPool
Definition: btSequentialImpulseConstraintSolver.h:43
btNNCGConstraintSolver::m_pCF
btAlignedObjectArray< btScalar > m_pCF
Definition: btNNCGConstraintSolver.h:29
btSolverConstraint::m_lowerLimit
btScalar m_lowerLimit
Definition: btSolverConstraint.h:51
btSolverConstraint::m_appliedImpulse
btSimdScalar m_appliedImpulse
Definition: btSolverConstraint.h:44
btContactSolverInfoData::m_timeStep
btScalar m_timeStep
Definition: btContactSolverInfo.h:42
btNNCGConstraintSolver::solveGroupCacheFriendlySetup
virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
Definition: btNNCGConstraintSolver.cpp:23
btSolverConstraint::m_frictionIndex
int m_frictionIndex
Definition: btSolverConstraint.h:62
btSequentialImpulseConstraintSolver::m_tmpSolverNonContactConstraintPool
btConstraintArray m_tmpSolverNonContactConstraintPool
Definition: btSequentialImpulseConstraintSolver.h:38
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:292
btSolverConstraint::m_contactNormal2
btVector3 m_contactNormal2
Definition: btSolverConstraint.h:38
btContactSolverInfoData::m_solverMode
int m_solverMode
Definition: btContactSolverInfo.h:59