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

Bullet Collision Detection & Physics Library

btMultiBodyConstraint.cpp
Go to the documentation of this file.
1 #include "btMultiBodyConstraint.h"
2 #include "BulletDynamics/Dynamics/btRigidBody.h"
3 #include "btMultiBodyPoint2Point.h" //for testing (BTMBP2PCONSTRAINT_BLOCK_ANGULAR_MOTION_TEST macro)
4
5
6
7 btMultiBodyConstraint::btMultiBodyConstraint(btMultiBody* bodyA,btMultiBody* bodyB,int linkA, int linkB, int numRows, bool isUnilateral)
8 :m_bodyA(bodyA),
9 m_bodyB(bodyB),
10 m_linkA(linkA),
11 m_linkB(linkB),
12 m_numRows(numRows),
13 m_jacSizeA(0),
14 m_jacSizeBoth(0),
15 m_isUnilateral(isUnilateral),
16 m_numDofsFinalized(-1),
17 m_maxAppliedImpulse(100)
18 {
19
20 }
21
22 void btMultiBodyConstraint::updateJacobianSizes()
23 {
24 if(m_bodyA)
25 {
26 m_jacSizeA = (6 + m_bodyA->getNumDofs());
27 }
28
29 if(m_bodyB)
30 {
31 m_jacSizeBoth = m_jacSizeA + 6 + m_bodyB->getNumDofs();
32 }
33 else
34 m_jacSizeBoth = m_jacSizeA;
35 }
36
37 void btMultiBodyConstraint::allocateJacobiansMultiDof()
38 {
39 updateJacobianSizes();
40
41 m_posOffset = ((1 + m_jacSizeBoth)*m_numRows);
42 m_data.resize((2 + m_jacSizeBoth) * m_numRows);
43 }
44
45 btMultiBodyConstraint::~btMultiBodyConstraint()
46 {
47 }
48
49 void btMultiBodyConstraint::applyDeltaVee(btMultiBodyJacobianData& data, btScalar* delta_vee, btScalar impulse, int velocityIndex, int ndof)
50 {
51 for (int i = 0; i < ndof; ++i)
52 data.m_deltaVelocities[velocityIndex+i] += delta_vee[i] * impulse;
53 }
54
55 btScalar btMultiBodyConstraint::fillMultiBodyConstraint( btMultiBodySolverConstraint& solverConstraint,
56 btMultiBodyJacobianData& data,
57 btScalar* jacOrgA, btScalar* jacOrgB,
58 const btVector3& constraintNormalAng,
59 const btVector3& constraintNormalLin,
60 const btVector3& posAworld, const btVector3& posBworld,
61 btScalar posError,
62 const btContactSolverInfo& infoGlobal,
63 btScalar lowerLimit, btScalar upperLimit,
64 bool angConstraint,
65 btScalar relaxation,
66 bool isFriction, btScalar desiredVelocity, btScalar cfmSlip)
67 {
68 solverConstraint.m_multiBodyA = m_bodyA;
69 solverConstraint.m_multiBodyB = m_bodyB;
70 solverConstraint.m_linkA = m_linkA;
71 solverConstraint.m_linkB = m_linkB;
72
73 btMultiBody* multiBodyA = solverConstraint.m_multiBodyA;
74 btMultiBody* multiBodyB = solverConstraint.m_multiBodyB;
75
76 btSolverBody* bodyA = multiBodyA ? 0 : &data.m_solverBodyPool->at(solverConstraint.m_solverBodyIdA);
77 btSolverBody* bodyB = multiBodyB ? 0 : &data.m_solverBodyPool->at(solverConstraint.m_solverBodyIdB);
78
79 btRigidBody* rb0 = multiBodyA ? 0 : bodyA->m_originalBody;
80 btRigidBody* rb1 = multiBodyB ? 0 : bodyB->m_originalBody;
81
82 btVector3 rel_pos1, rel_pos2; //these two used to be inited to posAworld and posBworld (respectively) but it does not seem necessary
83 if (bodyA)
84 rel_pos1 = posAworld - bodyA->getWorldTransform().getOrigin();
85 if (bodyB)
86 rel_pos2 = posBworld - bodyB->getWorldTransform().getOrigin();
87
88 if (multiBodyA)
89 {
90 if (solverConstraint.m_linkA<0)
91 {
92 rel_pos1 = posAworld - multiBodyA->getBasePos();
93 } else
94 {
95 rel_pos1 = posAworld - multiBodyA->getLink(solverConstraint.m_linkA).m_cachedWorldTransform.getOrigin();
96 }
97
98 const int ndofA = multiBodyA->getNumDofs() + 6;
99
100 solverConstraint.m_deltaVelAindex = multiBodyA->getCompanionId();
101
102 if (solverConstraint.m_deltaVelAindex <0)
103 {
104 solverConstraint.m_deltaVelAindex = data.m_deltaVelocities.size();
105 multiBodyA->setCompanionId(solverConstraint.m_deltaVelAindex);
106 data.m_deltaVelocities.resize(data.m_deltaVelocities.size()+ndofA);
107 } else
108 {
109 btAssert(data.m_deltaVelocities.size() >= solverConstraint.m_deltaVelAindex+ndofA);
110 }
111
112 //determine jacobian of this 1D constraint in terms of multibodyA's degrees of freedom
113 //resize..
114 solverConstraint.m_jacAindex = data.m_jacobians.size();
115 data.m_jacobians.resize(data.m_jacobians.size()+ndofA);
116 //copy/determine
117 if(jacOrgA)
118 {
119 for (int i=0;i<ndofA;i++)
120 data.m_jacobians[solverConstraint.m_jacAindex+i] = jacOrgA[i];
121 }
122 else
123 {
124 btScalar* jac1=&data.m_jacobians[solverConstraint.m_jacAindex];
125 //multiBodyA->fillContactJacobianMultiDof(solverConstraint.m_linkA, posAworld, constraintNormalLin, jac1, data.scratch_r, data.scratch_v, data.scratch_m);
126 multiBodyA->fillConstraintJacobianMultiDof(solverConstraint.m_linkA, posAworld, constraintNormalAng, constraintNormalLin, jac1, data.scratch_r, data.scratch_v, data.scratch_m);
127 }
128
129 //determine the velocity response of multibodyA to reaction impulses of this constraint (i.e. A[i,i] for i=1,...n_con: multibody's inverse inertia with respect to this 1D constraint)
130 //resize..
131 data.m_deltaVelocitiesUnitImpulse.resize(data.m_deltaVelocitiesUnitImpulse.size()+ndofA); //=> each constraint row has the constrained tree dofs allocated in m_deltaVelocitiesUnitImpulse
132 btAssert(data.m_jacobians.size() == data.m_deltaVelocitiesUnitImpulse.size());
133 btScalar* delta = &data.m_deltaVelocitiesUnitImpulse[solverConstraint.m_jacAindex];
134 //determine..
135 multiBodyA->calcAccelerationDeltasMultiDof(&data.m_jacobians[solverConstraint.m_jacAindex],delta,data.scratch_r, data.scratch_v);
136
137 btVector3 torqueAxis0;
138 if (angConstraint) {
139 torqueAxis0 = constraintNormalAng;
140 }
141 else {
142 torqueAxis0 = rel_pos1.cross(constraintNormalLin);
143
144 }
145 solverConstraint.m_relpos1CrossNormal = torqueAxis0;
146 solverConstraint.m_contactNormal1 = constraintNormalLin;
147 }
148 else //if(rb0)
149 {
150 btVector3 torqueAxis0;
151 if (angConstraint) {
152 torqueAxis0 = constraintNormalAng;
153 }
154 else {
155 torqueAxis0 = rel_pos1.cross(constraintNormalLin);
156 }
157 solverConstraint.m_angularComponentA = rb0 ? rb0->getInvInertiaTensorWorld()*torqueAxis0*rb0->getAngularFactor() : btVector3(0,0,0);
158 solverConstraint.m_relpos1CrossNormal = torqueAxis0;
159 solverConstraint.m_contactNormal1 = constraintNormalLin;
160 }
161
162 if (multiBodyB)
163 {
164 if (solverConstraint.m_linkB<0)
165 {
166 rel_pos2 = posBworld - multiBodyB->getBasePos();
167 } else
168 {
169 rel_pos2 = posBworld - multiBodyB->getLink(solverConstraint.m_linkB).m_cachedWorldTransform.getOrigin();
170 }
171
172 const int ndofB = multiBodyB->getNumDofs() + 6;
173
174 solverConstraint.m_deltaVelBindex = multiBodyB->getCompanionId();
175 if (solverConstraint.m_deltaVelBindex <0)
176 {
177 solverConstraint.m_deltaVelBindex = data.m_deltaVelocities.size();
178 multiBodyB->setCompanionId(solverConstraint.m_deltaVelBindex);
179 data.m_deltaVelocities.resize(data.m_deltaVelocities.size()+ndofB);
180 }
181
182 //determine jacobian of this 1D constraint in terms of multibodyB's degrees of freedom
183 //resize..
184 solverConstraint.m_jacBindex = data.m_jacobians.size();
185 data.m_jacobians.resize(data.m_jacobians.size()+ndofB);
186 //copy/determine..
187 if(jacOrgB)
188 {
189 for (int i=0;i<ndofB;i++)
190 data.m_jacobians[solverConstraint.m_jacBindex+i] = jacOrgB[i];
191 }
192 else
193 {
194 //multiBodyB->fillContactJacobianMultiDof(solverConstraint.m_linkB, posBworld, -constraintNormalLin, &data.m_jacobians[solverConstraint.m_jacBindex], data.scratch_r, data.scratch_v, data.scratch_m);
195 multiBodyB->fillConstraintJacobianMultiDof(solverConstraint.m_linkB, posBworld, -constraintNormalAng, -constraintNormalLin, &data.m_jacobians[solverConstraint.m_jacBindex], data.scratch_r, data.scratch_v, data.scratch_m);
196 }
197
198 //determine velocity response of multibodyB to reaction impulses of this constraint (i.e. A[i,i] for i=1,...n_con: multibody's inverse inertia with respect to this 1D constraint)
199 //resize..
200 data.m_deltaVelocitiesUnitImpulse.resize(data.m_deltaVelocitiesUnitImpulse.size()+ndofB);
201 btAssert(data.m_jacobians.size() == data.m_deltaVelocitiesUnitImpulse.size());
202 btScalar* delta = &data.m_deltaVelocitiesUnitImpulse[solverConstraint.m_jacBindex];
203 //determine..
204 multiBodyB->calcAccelerationDeltasMultiDof(&data.m_jacobians[solverConstraint.m_jacBindex],delta,data.scratch_r, data.scratch_v);
205
206 btVector3 torqueAxis1;
207 if (angConstraint) {
208 torqueAxis1 = constraintNormalAng;
209 }
210 else {
211 torqueAxis1 = rel_pos2.cross(constraintNormalLin);
212 }
213 solverConstraint.m_relpos2CrossNormal = -torqueAxis1;
214 solverConstraint.m_contactNormal2 = -constraintNormalLin;
215 }
216 else //if(rb1)
217 {
218 btVector3 torqueAxis1;
219 if (angConstraint) {
220 torqueAxis1 = constraintNormalAng;
221 }
222 else {
223 torqueAxis1 = rel_pos2.cross(constraintNormalLin);
224 }
225 solverConstraint.m_angularComponentB = rb1 ? rb1->getInvInertiaTensorWorld()*-torqueAxis1*rb1->getAngularFactor() : btVector3(0,0,0);
226 solverConstraint.m_relpos2CrossNormal = -torqueAxis1;
227 solverConstraint.m_contactNormal2 = -constraintNormalLin;
228 }
229 {
230
231 btVector3 vec;
232 btScalar denom0 = 0.f;
233 btScalar denom1 = 0.f;
234 btScalar* jacB = 0;
235 btScalar* jacA = 0;
236 btScalar* deltaVelA = 0;
237 btScalar* deltaVelB = 0;
238 int ndofA = 0;
239 //determine the "effective mass" of the constrained multibodyA with respect to this 1D constraint (i.e. 1/A[i,i])
240 if (multiBodyA)
241 {
242 ndofA = multiBodyA->getNumDofs() + 6;
243 jacA = &data.m_jacobians[solverConstraint.m_jacAindex];
244 deltaVelA = &data.m_deltaVelocitiesUnitImpulse[solverConstraint.m_jacAindex];
245 for (int i = 0; i < ndofA; ++i)
246 {
247 btScalar j = jacA[i] ;
248 btScalar l = deltaVelA[i];
249 denom0 += j*l;
250 }
251 }
252 else if(rb0)
253 {
254 vec = ( solverConstraint.m_angularComponentA).cross(rel_pos1);
255 if (angConstraint) {
256 denom0 = rb0->getInvMass() + constraintNormalAng.dot(vec);
257 }
258 else {
259 denom0 = rb0->getInvMass() + constraintNormalLin.dot(vec);
260 }
261 }
262 //
263 if (multiBodyB)
264 {
265 const int ndofB = multiBodyB->getNumDofs() + 6;
266 jacB = &data.m_jacobians[solverConstraint.m_jacBindex];
267 deltaVelB = &data.m_deltaVelocitiesUnitImpulse[solverConstraint.m_jacBindex];
268 for (int i = 0; i < ndofB; ++i)
269 {
270 btScalar j = jacB[i] ;
271 btScalar l = deltaVelB[i];
272 denom1 += j*l;
273 }
274
275 }
276 else if(rb1)
277 {
278 vec = ( -solverConstraint.m_angularComponentB).cross(rel_pos2);
279 if (angConstraint) {
280 denom1 = rb1->getInvMass() + constraintNormalAng.dot(vec);
281 }
282 else {
283 denom1 = rb1->getInvMass() + constraintNormalLin.dot(vec);
284 }
285 }
286
287 //
288 btScalar d = denom0+denom1;
289 if (d>SIMD_EPSILON)
290 {
291 solverConstraint.m_jacDiagABInv = relaxation/(d);
292 }
293 else
294 {
295 //disable the constraint row to handle singularity/redundant constraint
296 solverConstraint.m_jacDiagABInv = 0.f;
297 }
298 }
299
300
301 //compute rhs and remaining solverConstraint fields
302 btScalar penetration = isFriction? 0 : posError;
303
304 btScalar rel_vel = 0.f;
305 int ndofA = 0;
306 int ndofB = 0;
307 {
308 btVector3 vel1,vel2;
309 if (multiBodyA)
310 {
311 ndofA = multiBodyA->getNumDofs() + 6;
312 btScalar* jacA = &data.m_jacobians[solverConstraint.m_jacAindex];
313 for (int i = 0; i < ndofA ; ++i)
314 rel_vel += multiBodyA->getVelocityVector()[i] * jacA[i];
315 }
316 else if(rb0)
317 {
318 rel_vel += rb0->getVelocityInLocalPoint(rel_pos1).dot(solverConstraint.m_contactNormal1);
319 }
320 if (multiBodyB)
321 {
322 ndofB = multiBodyB->getNumDofs() + 6;
323 btScalar* jacB = &data.m_jacobians[solverConstraint.m_jacBindex];
324 for (int i = 0; i < ndofB ; ++i)
325 rel_vel += multiBodyB->getVelocityVector()[i] * jacB[i];
326
327 }
328 else if(rb1)
329 {
330 rel_vel += rb1->getVelocityInLocalPoint(rel_pos2).dot(solverConstraint.m_contactNormal2);
331 }
332
333 solverConstraint.m_friction = 0.f;//cp.m_combinedFriction;
334 }
335
336
338 /*
339 if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
340 {
341 solverConstraint.m_appliedImpulse = isFriction ? 0 : cp.m_appliedImpulse * infoGlobal.m_warmstartingFactor;
342
343 if (solverConstraint.m_appliedImpulse)
344 {
345 if (multiBodyA)
346 {
347 btScalar impulse = solverConstraint.m_appliedImpulse;
348 btScalar* deltaV = &data.m_deltaVelocitiesUnitImpulse[solverConstraint.m_jacAindex];
349 multiBodyA->applyDeltaVee(deltaV,impulse);
350 applyDeltaVee(data,deltaV,impulse,solverConstraint.m_deltaVelAindex,ndofA);
351 } else
352 {
353 if (rb0)
354 bodyA->internalApplyImpulse(solverConstraint.m_contactNormal1*bodyA->internalGetInvMass()*rb0->getLinearFactor(),solverConstraint.m_angularComponentA,solverConstraint.m_appliedImpulse);
355 }
356 if (multiBodyB)
357 {
358 btScalar impulse = solverConstraint.m_appliedImpulse;
359 btScalar* deltaV = &data.m_deltaVelocitiesUnitImpulse[solverConstraint.m_jacBindex];
360 multiBodyB->applyDeltaVee(deltaV,impulse);
361 applyDeltaVee(data,deltaV,impulse,solverConstraint.m_deltaVelBindex,ndofB);
362 } else
363 {
364 if (rb1)
365 bodyB->internalApplyImpulse(-solverConstraint.m_contactNormal2*bodyB->internalGetInvMass()*rb1->getLinearFactor(),-solverConstraint.m_angularComponentB,-(btScalar)solverConstraint.m_appliedImpulse);
366 }
367 }
368 } else
369 */
370
371 solverConstraint.m_appliedImpulse = 0.f;
372 solverConstraint.m_appliedPushImpulse = 0.f;
373
374 {
375
376 btScalar positionalError = 0.f;
377 btScalar velocityError = desiredVelocity - rel_vel;// * damping;
378
379
380 btScalar erp = infoGlobal.m_erp2;
381
382 //split impulse is not implemented yet for btMultiBody*
383 //if (!infoGlobal.m_splitImpulse || (penetration > infoGlobal.m_splitImpulsePenetrationThreshold))
384 {
385 erp = infoGlobal.m_erp;
386 }
387
388 positionalError = -penetration * erp/infoGlobal.m_timeStep;
389
390 btScalar penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv;
391 btScalar velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv;
392
393 //split impulse is not implemented yet for btMultiBody*
394
395 // if (!infoGlobal.m_splitImpulse || (penetration > infoGlobal.m_splitImpulsePenetrationThreshold))
396 {
397 //combine position and velocity into rhs
398 solverConstraint.m_rhs = penetrationImpulse+velocityImpulse;
399 solverConstraint.m_rhsPenetration = 0.f;
400
401 }
402 /*else
403 {
404 //split position and velocity into rhs and m_rhsPenetration
405 solverConstraint.m_rhs = velocityImpulse;
406 solverConstraint.m_rhsPenetration = penetrationImpulse;
407 }
408 */
409
410 solverConstraint.m_cfm = 0.f;
411 solverConstraint.m_lowerLimit = lowerLimit;
412 solverConstraint.m_upperLimit = upperLimit;
413 }
414
415 return rel_vel;
416
417 }
SIMD_EPSILON
#define SIMD_EPSILON
Definition: btScalar.h:521
btMultiBodySolverConstraint::m_rhsPenetration
btScalar m_rhsPenetration
Definition: btMultiBodySolverConstraint.h:59
btMultiBody::getBasePos
const btVector3 & getBasePos() const
Definition: btMultiBody.h:186
btMultiBodySolverConstraint::m_relpos1CrossNormal
btVector3 m_relpos1CrossNormal
Definition: btMultiBodySolverConstraint.h:40
btContactSolverInfoData::m_erp
btScalar m_erp
Definition: btContactSolverInfo.h:47
btMultiBodySolverConstraint
1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and fr...
Definition: btMultiBodySolverConstraint.h:28
btMultiBodySolverConstraint::m_contactNormal2
btVector3 m_contactNormal2
Definition: btMultiBodySolverConstraint.h:43
btMultiBodyJacobianData::scratch_r
btAlignedObjectArray< btScalar > scratch_r
Definition: btMultiBodyConstraint.h:33
btMultiBodyJacobianData::m_deltaVelocities
btAlignedObjectArray< btScalar > m_deltaVelocities
Definition: btMultiBodyConstraint.h:32
btMultiBodyJacobianData::m_solverBodyPool
btAlignedObjectArray< btSolverBody > * m_solverBodyPool
Definition: btMultiBodyConstraint.h:36
btMultiBodySolverConstraint::m_angularComponentA
btVector3 m_angularComponentA
Definition: btMultiBodySolverConstraint.h:46
btMultiBodySolverConstraint::m_angularComponentB
btVector3 m_angularComponentB
Definition: btMultiBodySolverConstraint.h:47
btMultiBodyConstraint::m_bodyB
btMultiBody * m_bodyB
Definition: btMultiBodyConstraint.h:47
btAssert
#define btAssert(x)
Definition: btScalar.h:131
btAlignedObjectArray::at
const T & at(int n) const
Definition: btAlignedObjectArray.h:160
btMultiBodyConstraint.h
btMultiBodyConstraint::~btMultiBodyConstraint
virtual ~btMultiBodyConstraint()
Definition: btMultiBodyConstraint.cpp:45
btMultiBodyConstraint::m_posOffset
int m_posOffset
Definition: btMultiBodyConstraint.h:54
btMultiBody::getCompanionId
int getCompanionId() const
Definition: btMultiBody.h:482
btMultiBody::calcAccelerationDeltasMultiDof
void calcAccelerationDeltasMultiDof(const btScalar *force, btScalar *output, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v) const
Definition: btMultiBody.cpp:1377
btMultiBody
Definition: btMultiBody.h:51
btRigidBody.h
btRigidBody::getAngularFactor
const btVector3 & getAngularFactor() const
Definition: btRigidBody.h:504
btMultiBodyJacobianData::scratch_m
btAlignedObjectArray< btMatrix3x3 > scratch_m
Definition: btMultiBodyConstraint.h:35
btMultiBodySolverConstraint::m_deltaVelBindex
int m_deltaVelBindex
Definition: btMultiBodySolverConstraint.h:37
btMultiBodySolverConstraint::m_deltaVelAindex
int m_deltaVelAindex
Definition: btMultiBodySolverConstraint.h:35
btMultiBodyJacobianData::m_deltaVelocitiesUnitImpulse
btAlignedObjectArray< btScalar > m_deltaVelocitiesUnitImpulse
Definition: btMultiBodyConstraint.h:31
btMultiBodySolverConstraint::m_jacBindex
int m_jacBindex
Definition: btMultiBodySolverConstraint.h:38
btTransform::getOrigin
btVector3 & getOrigin()
Return the origin vector translation.
Definition: btTransform.h:117
btMultiBodySolverConstraint::m_multiBodyA
btMultiBody * m_multiBodyA
Definition: btMultiBodySolverConstraint.h:70
btMultiBodyPoint2Point.h
btMultiBody::setCompanionId
void setCompanionId(int id)
Definition: btMultiBody.h:486
btRigidBody::getInvMass
btScalar getInvMass() const
Definition: btRigidBody.h:273
btVector3::cross
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
Definition: btVector3.h:389
btMultiBodyConstraint::m_jacSizeA
int m_jacSizeA
Definition: btMultiBodyConstraint.h:52
btVector3::dot
btScalar dot(const btVector3 &v) const
Return the dot product.
Definition: btVector3.h:235
btMultiBody::getNumDofs
int getNumDofs() const
Definition: btMultiBody.h:165
btMultiBodyConstraint::m_jacSizeBoth
int m_jacSizeBoth
Definition: btMultiBodyConstraint.h:53
btMultiBodySolverConstraint::m_multiBodyB
btMultiBody * m_multiBodyB
Definition: btMultiBodySolverConstraint.h:74
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:62
btMultiBodySolverConstraint::m_linkA
int m_linkA
Definition: btMultiBodySolverConstraint.h:71
btMultiBodySolverConstraint::m_jacAindex
int m_jacAindex
Definition: btMultiBodySolverConstraint.h:36
btContactSolverInfoData::m_erp2
btScalar m_erp2
Definition: btContactSolverInfo.h:48
btMultiBodyJacobianData
Definition: btMultiBodyConstraint.h:28
btMultiBodyConstraint::m_data
btAlignedObjectArray< btScalar > m_data
Definition: btMultiBodyConstraint.h:66
btMultiBodyJacobianData::m_jacobians
btAlignedObjectArray< btScalar > m_jacobians
Definition: btMultiBodyConstraint.h:30
btMultiBodySolverConstraint::m_rhs
btScalar m_rhs
Definition: btMultiBodySolverConstraint.h:54
btMultiBody::getLink
const btMultibodyLink & getLink(int index) const
Definition: btMultiBody.h:119
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:155
btRigidBody::getVelocityInLocalPoint
btVector3 getVelocityInLocalPoint(const btVector3 &rel_pos) const
Definition: btRigidBody.h:382
btMultiBodyJacobianData::scratch_v
btAlignedObjectArray< btVector3 > scratch_v
Definition: btMultiBodyConstraint.h:34
btContactSolverInfo
Definition: btContactSolverInfo.h:69
btMultiBodySolverConstraint::m_appliedImpulse
btSimdScalar m_appliedImpulse
Definition: btMultiBodySolverConstraint.h:50
btMultiBodySolverConstraint::m_solverBodyIdB
int m_solverBodyIdB
Definition: btMultiBodySolverConstraint.h:73
btSolverBody
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
Definition: btSolverBody.h:108
btMultiBodySolverConstraint::m_upperLimit
btScalar m_upperLimit
Definition: btMultiBodySolverConstraint.h:58
btSolverBody::getWorldTransform
const btTransform & getWorldTransform() const
Definition: btSolverBody.h:130
btAlignedObjectArray::resize
void resize(int newsize, const T &fillData=T())
Definition: btAlignedObjectArray.h:218
btSolverBody::m_originalBody
btRigidBody * m_originalBody
Definition: btSolverBody.h:124
btMultiBodyConstraint::m_numRows
int m_numRows
Definition: btMultiBodyConstraint.h:51
btMultiBodySolverConstraint::m_friction
btScalar m_friction
Definition: btMultiBodySolverConstraint.h:52
btMultiBodyConstraint::m_bodyA
btMultiBody * m_bodyA
Definition: btMultiBodyConstraint.h:46
btMultiBodySolverConstraint::m_linkB
int m_linkB
Definition: btMultiBodySolverConstraint.h:75
btMultiBodySolverConstraint::m_relpos2CrossNormal
btVector3 m_relpos2CrossNormal
Definition: btMultiBodySolverConstraint.h:42
btMultibodyLink::m_cachedWorldTransform
btTransform m_cachedWorldTransform
Definition: btMultiBodyLink.h:141
btMultiBody::fillConstraintJacobianMultiDof
void fillConstraintJacobianMultiDof(int link, const btVector3 &contact_point, const btVector3 &normal_ang, const btVector3 &normal_lin, btScalar *jac, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m) const
Definition: btMultiBody.cpp:1675
btMultiBodyConstraint::allocateJacobiansMultiDof
void allocateJacobiansMultiDof()
Definition: btMultiBodyConstraint.cpp:37
btMultiBodyConstraint::btMultiBodyConstraint
btMultiBodyConstraint(btMultiBody *bodyA, btMultiBody *bodyB, int linkA, int linkB, int numRows, bool isUnilateral)
Definition: btMultiBodyConstraint.cpp:7
btRigidBody::getInvInertiaTensorWorld
const btMatrix3x3 & getInvInertiaTensorWorld() const
Definition: btRigidBody.h:274
btMultiBodySolverConstraint::m_appliedPushImpulse
btSimdScalar m_appliedPushImpulse
Definition: btMultiBodySolverConstraint.h:49
btMultiBodyConstraint::fillMultiBodyConstraint
btScalar fillMultiBodyConstraint(btMultiBodySolverConstraint &solverConstraint, btMultiBodyJacobianData &data, btScalar *jacOrgA, btScalar *jacOrgB, const btVector3 &constraintNormalAng, const btVector3 &constraintNormalLin, const btVector3 &posAworld, const btVector3 &posBworld, btScalar posError, const btContactSolverInfo &infoGlobal, btScalar lowerLimit, btScalar upperLimit, bool angConstraint=false, btScalar relaxation=1.f, bool isFriction=false, btScalar desiredVelocity=0, btScalar cfmSlip=0)
Definition: btMultiBodyConstraint.cpp:55
btMultiBodySolverConstraint::m_jacDiagABInv
btScalar m_jacDiagABInv
Definition: btMultiBodySolverConstraint.h:53
btContactSolverInfoData::m_timeStep
btScalar m_timeStep
Definition: btContactSolverInfo.h:42
btMultiBodySolverConstraint::m_solverBodyIdA
int m_solverBodyIdA
Definition: btMultiBodySolverConstraint.h:69
btMultiBodySolverConstraint::m_contactNormal1
btVector3 m_contactNormal1
Definition: btMultiBodySolverConstraint.h:41
btMultiBody::getVelocityVector
const btScalar * getVelocityVector() const
Definition: btMultiBody.h:258
btMultiBodyConstraint::updateJacobianSizes
void updateJacobianSizes()
Definition: btMultiBodyConstraint.cpp:22
btMultiBodySolverConstraint::m_cfm
btScalar m_cfm
Definition: btMultiBodySolverConstraint.h:55
btMultiBodyConstraint::applyDeltaVee
void applyDeltaVee(btMultiBodyJacobianData &data, btScalar *delta_vee, btScalar impulse, int velocityIndex, int ndof)
Definition: btMultiBodyConstraint.cpp:49
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:292
btMultiBodySolverConstraint::m_lowerLimit
btScalar m_lowerLimit
Definition: btMultiBodySolverConstraint.h:57
btMultiBodyConstraint::m_linkB
int m_linkB
Definition: btMultiBodyConstraint.h:49
btMultiBodyConstraint::m_linkA
int m_linkA
Definition: btMultiBodyConstraint.h:48