Bullet Collision Detection & Physics Library
btMultiBody.h
Go to the documentation of this file.
1/*
2 * PURPOSE:
3 * Class representing an articulated rigid body. Stores the body's
4 * current state, allows forces and torques to be set, handles
5 * timestepping and implements Featherstone's algorithm.
6 *
7 * COPYRIGHT:
8 * Copyright (C) Stephen Thompson, <stephen@solarflare.org.uk>, 2011-2013
9 * Portions written By Erwin Coumans: connection to LCP solver, various multibody constraints, replacing Eigen math library by Bullet LinearMath and a dedicated 6x6 matrix inverse (solveImatrix)
10 * Portions written By Jakub Stepien: support for multi-DOF constraints, introduction of spatial algebra and several other improvements
11
12 This software is provided 'as-is', without any express or implied warranty.
13 In no event will the authors be held liable for any damages arising from the use of this software.
14 Permission is granted to anyone to use this software for any purpose,
15 including commercial applications, and to alter it and redistribute it freely,
16 subject to the following restrictions:
17
18 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.
19 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
20 3. This notice may not be removed or altered from any source distribution.
21
22 */
23
24
25#ifndef BT_MULTIBODY_H
26#define BT_MULTIBODY_H
27
28#include "LinearMath/btScalar.h"
33
34
36#ifdef BT_USE_DOUBLE_PRECISION
37 #define btMultiBodyData btMultiBodyDoubleData
38 #define btMultiBodyDataName "btMultiBodyDoubleData"
39 #define btMultiBodyLinkData btMultiBodyLinkDoubleData
40 #define btMultiBodyLinkDataName "btMultiBodyLinkDoubleData"
41#else
42 #define btMultiBodyData btMultiBodyFloatData
43 #define btMultiBodyDataName "btMultiBodyFloatData"
44 #define btMultiBodyLinkData btMultiBodyLinkFloatData
45 #define btMultiBodyLinkDataName "btMultiBodyLinkFloatData"
46#endif //BT_USE_DOUBLE_PRECISION
47
48#include "btMultiBodyLink.h"
50
52{
53public:
54
55
57
58 //
59 // initialization
60 //
61
62 btMultiBody(int n_links, // NOT including the base
63 btScalar mass, // mass of base
64 const btVector3 &inertia, // inertia of base, in base frame; assumed diagonal
65 bool fixedBase, // whether the base is fixed (true) or can move (false)
66 bool canSleep, bool deprecatedMultiDof=true);
67
68
69 virtual ~btMultiBody();
70
71 //note: fixed link collision with parent is always disabled
72 void setupFixed(int linkIndex,
73 btScalar mass,
74 const btVector3 &inertia,
75 int parent,
76 const btQuaternion &rotParentToThis,
77 const btVector3 &parentComToThisPivotOffset,
78 const btVector3 &thisPivotToThisComOffset, bool deprecatedDisableParentCollision=true);
79
80
81 void setupPrismatic(int i,
82 btScalar mass,
83 const btVector3 &inertia,
84 int parent,
85 const btQuaternion &rotParentToThis,
86 const btVector3 &jointAxis,
87 const btVector3 &parentComToThisPivotOffset,
88 const btVector3 &thisPivotToThisComOffset,
89 bool disableParentCollision);
90
91 void setupRevolute(int linkIndex, // 0 to num_links-1
92 btScalar mass,
93 const btVector3 &inertia,
94 int parentIndex,
95 const btQuaternion &rotParentToThis, // rotate points in parent frame to this frame, when q = 0
96 const btVector3 &jointAxis, // in my frame
97 const btVector3 &parentComToThisPivotOffset, // vector from parent COM to joint axis, in PARENT frame
98 const btVector3 &thisPivotToThisComOffset, // vector from joint axis to my COM, in MY frame
99 bool disableParentCollision=false);
100
101 void setupSpherical(int linkIndex, // 0 to num_links-1
102 btScalar mass,
103 const btVector3 &inertia,
104 int parent,
105 const btQuaternion &rotParentToThis, // rotate points in parent frame to this frame, when q = 0
106 const btVector3 &parentComToThisPivotOffset, // vector from parent COM to joint axis, in PARENT frame
107 const btVector3 &thisPivotToThisComOffset, // vector from joint axis to my COM, in MY frame
108 bool disableParentCollision=false);
109
110 void setupPlanar(int i, // 0 to num_links-1
111 btScalar mass,
112 const btVector3 &inertia,
113 int parent,
114 const btQuaternion &rotParentToThis, // rotate points in parent frame to this frame, when q = 0
115 const btVector3 &rotationAxis,
116 const btVector3 &parentComToThisComOffset, // vector from parent COM to this COM, in PARENT frame
117 bool disableParentCollision=false);
118
119 const btMultibodyLink& getLink(int index) const
120 {
121 return m_links[index];
122 }
123
125 {
126 return m_links[index];
127 }
128
129
130 void setBaseCollider(btMultiBodyLinkCollider* collider)//collider can be NULL to disable collision for the base
131 {
132 m_baseCollider = collider;
133 }
135 {
136 return m_baseCollider;
137 }
142
144 {
145 if (index >= 0 && index < getNumLinks())
146 {
147 return getLink(index).m_collider;
148 }
149 return 0;
150 }
151
152 //
153 // get parent
154 // input: link num from 0 to num_links-1
155 // output: link num from 0 to num_links-1, OR -1 to mean the base.
156 //
157 int getParent(int link_num) const;
158
159
160 //
161 // get number of m_links, masses, moments of inertia
162 //
163
164 int getNumLinks() const { return m_links.size(); }
165 int getNumDofs() const { return m_dofCount; }
166 int getNumPosVars() const { return m_posVarCnt; }
167 btScalar getBaseMass() const { return m_baseMass; }
168 const btVector3 & getBaseInertia() const { return m_baseInertia; }
169 btScalar getLinkMass(int i) const;
170 const btVector3 & getLinkInertia(int i) const;
171
172
173
174 //
175 // change mass (incomplete: can only change base mass and inertia at present)
176 //
177
178 void setBaseMass(btScalar mass) { m_baseMass = mass; }
179 void setBaseInertia(const btVector3 &inertia) { m_baseInertia = inertia; }
180
181
182 //
183 // get/set pos/vel/rot/omega for the base link
184 //
185
186 const btVector3 & getBasePos() const { return m_basePos; } // in world frame
187 const btVector3 getBaseVel() const
188 {
189 return btVector3(m_realBuf[3],m_realBuf[4],m_realBuf[5]);
190 } // in world frame
192 {
193 return m_baseQuat;
194 } // rotates world vectors into base frame
195 btVector3 getBaseOmega() const { return btVector3(m_realBuf[0],m_realBuf[1],m_realBuf[2]); } // in world frame
196
197 void setBasePos(const btVector3 &pos)
198 {
199 m_basePos = pos;
200 }
201
203 {
204 setBasePos(tr.getOrigin());
206
207 }
208
210 {
211 btTransform tr;
212 tr.setOrigin(getBasePos());
214 return tr;
215 }
216
217 void setBaseVel(const btVector3 &vel)
218 {
219
220 m_realBuf[3]=vel[0]; m_realBuf[4]=vel[1]; m_realBuf[5]=vel[2];
221 }
223 {
224 m_baseQuat = rot; //m_baseQuat asumed to ba alias!?
225 }
226 void setBaseOmega(const btVector3 &omega)
227 {
228 m_realBuf[0]=omega[0];
229 m_realBuf[1]=omega[1];
230 m_realBuf[2]=omega[2];
231 }
232
233
234 //
235 // get/set pos/vel for child m_links (i = 0 to num_links-1)
236 //
237
238 btScalar getJointPos(int i) const;
239 btScalar getJointVel(int i) const;
240
241 btScalar * getJointVelMultiDof(int i);
242 btScalar * getJointPosMultiDof(int i);
243
244 const btScalar * getJointVelMultiDof(int i) const ;
245 const btScalar * getJointPosMultiDof(int i) const ;
246
247 void setJointPos(int i, btScalar q);
248 void setJointVel(int i, btScalar qdot);
249 void setJointPosMultiDof(int i, btScalar *q);
250 void setJointVelMultiDof(int i, btScalar *qdot);
251
252
253
254 //
255 // direct access to velocities as a vector of 6 + num_links elements.
256 // (omega first, then v, then joint velocities.)
257 //
259 {
260 return &m_realBuf[0];
261 }
262/* btScalar * getVelocityVector()
263 {
264 return &real_buf[0];
265 }
266 */
267
268 //
269 // get the frames of reference (positions and orientations) of the child m_links
270 // (i = 0 to num_links-1)
271 //
272
273 const btVector3 & getRVector(int i) const; // vector from COM(parent(i)) to COM(i), in frame i's coords
274 const btQuaternion & getParentToLocalRot(int i) const; // rotates vectors in frame parent(i) to vectors in frame i.
275
276
277 //
278 // transform vectors in local frame of link i to world frame (or vice versa)
279 //
280 btVector3 localPosToWorld(int i, const btVector3 &vec) const;
281 btVector3 localDirToWorld(int i, const btVector3 &vec) const;
282 btVector3 worldPosToLocal(int i, const btVector3 &vec) const;
283 btVector3 worldDirToLocal(int i, const btVector3 &vec) const;
284
285 //
286 // transform a frame in local coordinate to a frame in world coordinate
287 //
288 btMatrix3x3 localFrameToWorld(int i, const btMatrix3x3 &mat) const;
289
290 //
291 // calculate kinetic energy and angular momentum
292 // useful for debugging.
293 //
294
295 btScalar getKineticEnergy() const;
296 btVector3 getAngularMomentum() const;
297
298
299 //
300 // set external forces and torques. Note all external forces/torques are given in the WORLD frame.
301 //
302
303 void clearForcesAndTorques();
304 void clearConstraintForces();
305
306 void clearVelocities();
307
308 void addBaseForce(const btVector3 &f)
309 {
310 m_baseForce += f;
311 }
312 void addBaseTorque(const btVector3 &t) { m_baseTorque += t; }
313 void addLinkForce(int i, const btVector3 &f);
314 void addLinkTorque(int i, const btVector3 &t);
315
317 {
319 }
321 void addLinkConstraintForce(int i, const btVector3 &f);
322 void addLinkConstraintTorque(int i, const btVector3 &t);
323
324
325void addJointTorque(int i, btScalar Q);
326 void addJointTorqueMultiDof(int i, int dof, btScalar Q);
327 void addJointTorqueMultiDof(int i, const btScalar *Q);
328
329 const btVector3 & getBaseForce() const { return m_baseForce; }
330 const btVector3 & getBaseTorque() const { return m_baseTorque; }
331 const btVector3 & getLinkForce(int i) const;
332 const btVector3 & getLinkTorque(int i) const;
333 btScalar getJointTorque(int i) const;
334 btScalar * getJointTorqueMultiDof(int i);
335
336
337 //
338 // dynamics routines.
339 //
340
341 // timestep the velocities (given the external forces/torques set using addBaseForce etc).
342 // also sets up caches for calcAccelerationDeltas.
343 //
344 // Note: the caller must provide three vectors which are used as
345 // temporary scratch space. The idea here is to reduce dynamic
346 // memory allocation: the same scratch vectors can be re-used
347 // again and again for different Multibodies, instead of each
348 // btMultiBody allocating (and then deallocating) their own
349 // individual scratch buffers. This gives a considerable speed
350 // improvement, at least on Windows (where dynamic memory
351 // allocation appears to be fairly slow).
352 //
353
354
355 void computeAccelerationsArticulatedBodyAlgorithmMultiDof(btScalar dt,
359 bool isConstraintPass=false
360 );
361
367 bool isConstraintPass=false)
368 {
369 computeAccelerationsArticulatedBodyAlgorithmMultiDof(dt,scratch_r,scratch_v,scratch_m,isConstraintPass);
370 }
371
372 // calcAccelerationDeltasMultiDof
373 // input: force vector (in same format as jacobian, i.e.:
374 // 3 torque values, 3 force values, num_links joint torque values)
375 // output: 3 omegadot values, 3 vdot values, num_links q_double_dot values
376 // (existing contents of output array are replaced)
377 // calcAccelerationDeltasMultiDof must have been called first.
378 void calcAccelerationDeltasMultiDof(const btScalar *force, btScalar *output,
380 btAlignedObjectArray<btVector3> &scratch_v) const;
381
382
383 void applyDeltaVeeMultiDof2(const btScalar * delta_vee, btScalar multiplier)
384 {
385 for (int dof = 0; dof < 6 + getNumDofs(); ++dof)
386 {
387 m_deltaV[dof] += delta_vee[dof] * multiplier;
388 }
389 }
391 {
393
394 for (int dof = 0; dof < 6 + getNumDofs(); ++dof)
395 {
396 m_deltaV[dof] = 0.f;
397 }
398 }
399
400 void applyDeltaVeeMultiDof(const btScalar * delta_vee, btScalar multiplier)
401 {
402 //for (int dof = 0; dof < 6 + getNumDofs(); ++dof)
403 // printf("%.4f ", delta_vee[dof]*multiplier);
404 //printf("\n");
405
406 //btScalar sum = 0;
407 //for (int dof = 0; dof < 6 + getNumDofs(); ++dof)
408 //{
409 // sum += delta_vee[dof]*multiplier*delta_vee[dof]*multiplier;
410 //}
411 //btScalar l = btSqrt(sum);
412
413 //if (l>m_maxAppliedImpulse)
414 //{
415 // multiplier *= m_maxAppliedImpulse/l;
416 //}
417
418 for (int dof = 0; dof < 6 + getNumDofs(); ++dof)
419 {
420 m_realBuf[dof] += delta_vee[dof] * multiplier;
422 }
423 }
424
425
426
427 // timestep the positions (given current velocities).
428 void stepPositionsMultiDof(btScalar dt, btScalar *pq = 0, btScalar *pqd = 0);
429
430
431 //
432 // contacts
433 //
434
435 // This routine fills out a contact constraint jacobian for this body.
436 // the 'normal' supplied must be -n for body1 or +n for body2 of the contact.
437 // 'normal' & 'contact_point' are both given in world coordinates.
438
440 const btVector3 &contact_point,
441 const btVector3 &normal,
442 btScalar *jac,
445 btAlignedObjectArray<btMatrix3x3> &scratch_m) const { fillConstraintJacobianMultiDof(link, contact_point, btVector3(0, 0, 0), normal, jac, scratch_r, scratch_v, scratch_m); }
446
447 //a more general version of fillContactJacobianMultiDof which does not assume..
448 //.. that the constraint in question is contact or, to be more precise, constrains linear velocity only
449 void fillConstraintJacobianMultiDof(int link,
450 const btVector3 &contact_point,
451 const btVector3 &normal_ang,
452 const btVector3 &normal_lin,
453 btScalar *jac,
456 btAlignedObjectArray<btMatrix3x3> &scratch_m) const;
457
458
459 //
460 // sleeping
461 //
462 void setCanSleep(bool canSleep)
463 {
464 m_canSleep = canSleep;
465 }
466
467 bool getCanSleep()const
468 {
469 return m_canSleep;
470 }
471
472 bool isAwake() const { return m_awake; }
473 void wakeUp();
474 void goToSleep();
475 void checkMotionAndSleepIfRequired(btScalar timestep);
476
477 bool hasFixedBase() const
478 {
479 return m_fixedBase;
480 }
481
482 int getCompanionId() const
483 {
484 return m_companionId;
485 }
486 void setCompanionId(int id)
487 {
488 //printf("for %p setCompanionId(%d)\n",this, id);
489 m_companionId = id;
490 }
491
492 void setNumLinks(int numLinks)//careful: when changing the number of m_links, make sure to re-initialize or update existing m_links
493 {
494 m_links.resize(numLinks);
495 }
496
498 {
499 return m_linearDamping;
500 }
502 {
503 m_linearDamping = damp;
504 }
506 {
507 return m_angularDamping;
508 }
510 {
511 m_angularDamping = damp;
512 }
513
514 bool getUseGyroTerm() const
515 {
516 return m_useGyroTerm;
517 }
518 void setUseGyroTerm(bool useGyro)
519 {
520 m_useGyroTerm = useGyro;
521 }
527 {
529 }
530
532 {
533 return m_maxAppliedImpulse;
534 }
536 {
537 m_maxAppliedImpulse = maxImp;
538 }
543 bool hasSelfCollision() const
544 {
545 return m_hasSelfCollision;
546 }
547
548
549 void finalizeMultiDof();
550
551 void useRK4Integration(bool use) { m_useRK4 = use; }
552 bool isUsingRK4Integration() const { return m_useRK4; }
555
556 bool isPosUpdated() const
557 {
558 return __posUpdated;
559 }
560 void setPosUpdated(bool updated)
561 {
562 __posUpdated = updated;
563 }
564
565 //internalNeedsJointFeedback is for internal use only
567 {
569 }
570 void forwardKinematics(btAlignedObjectArray<btQuaternion>& scratch_q,btAlignedObjectArray<btVector3>& scratch_m);
571
572 void compTreeLinkVelocities(btVector3 *omega, btVector3 *vel) const;
573
574 void updateCollisionObjectWorldTransforms(btAlignedObjectArray<btQuaternion>& scratch_q,btAlignedObjectArray<btVector3>& scratch_m);
575
576 virtual int calculateSerializeBufferSize() const;
577
579 virtual const char* serialize(void* dataBuffer, class btSerializer* serializer) const;
580
581 const char* getBaseName() const
582 {
583 return m_baseName;
584 }
585
586 void setBaseName(const char* name)
587 {
588 m_baseName = name;
589 }
590
592 void* getUserPointer() const
593 {
594 return m_userObjectPointer;
595 }
596
597 int getUserIndex() const
598 {
599 return m_userIndex;
600 }
601
602 int getUserIndex2() const
603 {
604 return m_userIndex2;
605 }
606
607 void setUserPointer(void* userPointer)
608 {
609 m_userObjectPointer = userPointer;
610 }
611
613 void setUserIndex(int index)
614 {
615 m_userIndex = index;
616 }
617
618 void setUserIndex2(int index)
619 {
620 m_userIndex2 = index;
621 }
622
623private:
624 btMultiBody(const btMultiBody &); // not implemented
625 void operator=(const btMultiBody &); // not implemented
626
627
628 void solveImatrix(const btVector3& rhs_top, const btVector3& rhs_bot, btScalar result[6]) const;
629 void solveImatrix(const btSpatialForceVector &rhs, btSpatialMotionVector &result) const;
630
632 {
633 int dofOffset = 0, cfgOffset = 0;
634 for(int bidx = 0; bidx < m_links.size(); ++bidx)
635 {
636 m_links[bidx].m_dofOffset = dofOffset; m_links[bidx].m_cfgOffset = cfgOffset;
637 dofOffset += m_links[bidx].m_dofCount; cfgOffset += m_links[bidx].m_posVarCount;
638 }
639 }
640
641 void mulMatrix(btScalar *pA, btScalar *pB, int rowsA, int colsA, int rowsB, int colsB, btScalar *pC) const;
642
643
644private:
645
647 const char* m_baseName;//memory needs to be manager by user!
648
649 btVector3 m_basePos; // position of COM of base (world frame)
650 btQuaternion m_baseQuat; // rotates world points into base frame
651
652 btScalar m_baseMass; // mass of the base
653 btVector3 m_baseInertia; // inertia of the base (in local frame; diagonal)
654
655 btVector3 m_baseForce; // external force applied to base. World frame.
656 btVector3 m_baseTorque; // external torque applied to base. World frame.
657
658 btVector3 m_baseConstraintForce; // external force applied to base. World frame.
659 btVector3 m_baseConstraintTorque; // external torque applied to base. World frame.
660
661 btAlignedObjectArray<btMultibodyLink> m_links; // array of m_links, excluding the base. index from 0 to num_links-1.
662
663
664 //
665 // realBuf:
666 // offset size array
667 // 0 6 + num_links v (base_omega; base_vel; joint_vels) MULTIDOF [sysdof x sysdof for D matrices (TOO MUCH!) + pos_delta which is sys-cfg sized]
668 // 6+num_links num_links D
669 //
670 // vectorBuf:
671 // offset size array
672 // 0 num_links h_top
673 // num_links num_links h_bottom
674 //
675 // matrixBuf:
676 // offset size array
677 // 0 num_links+1 rot_from_parent
678 //
683
684
690
692
693 // Sleep parameters.
697
701
709
713
716};
717
750
783
798
811
812
813
814#endif
void btClamp(T &a, const T &lb, const T &ub)
Definition btMinMax.h:59
#define output
btQuaternion inverse(const btQuaternion &q)
Return the inverse of a quaternion.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:292
#define ATTRIBUTE_ALIGNED16(a)
Definition btScalar.h:82
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual int calculateSerializeBufferSize() const
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
Definition btMatrix3x3.h:48
btScalar m_maxCoordinateVelocity
bool __posUpdated
void useRK4Integration(bool use)
void setMaxCoordinateVelocity(btScalar maxVel)
void setupPrismatic(int i, btScalar mass, const btVector3 &inertia, int parent, const btQuaternion &rotParentToThis, const btVector3 &jointAxis, const btVector3 &parentComToThisPivotOffset, const btVector3 &thisPivotToThisComOffset, bool disableParentCollision)
bool m_useGyroTerm
void computeAccelerationsArticulatedBodyAlgorithmMultiDof(btScalar dt, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m, bool isConstraintPass=false)
void setMaxAppliedImpulse(btScalar maxImp)
bool isAwake() const
btAlignedObjectArray< btMultibodyLink > m_links
btAlignedObjectArray< btMatrix3x3 > m_matrixBuf
btMultiBodyLinkCollider * m_baseCollider
void fillContactJacobianMultiDof(int link, const btVector3 &contact_point, const btVector3 &normal, btScalar *jac, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m) const
bool getUseGyroTerm() const
const btVector3 & getBasePos() const
void setCanSleep(bool canSleep)
void setUseGyroTerm(bool useGyro)
int getCompanionId() const
btScalar getAngularDamping() const
int getUserIndex2() const
btVector3 m_baseInertia
btAlignedObjectArray< btVector3 > m_vectorBuf
btVector3 m_baseForce
void addBaseConstraintForce(const btVector3 &f)
btScalar m_maxAppliedImpulse
void setBaseMass(btScalar mass)
void setBaseInertia(const btVector3 &inertia)
btScalar m_angularDamping
btQuaternion m_baseQuat
void setHasSelfCollision(bool hasSelfCollision)
void setupSpherical(int linkIndex, btScalar mass, const btVector3 &inertia, int parent, const btQuaternion &rotParentToThis, const btVector3 &parentComToThisPivotOffset, const btVector3 &thisPivotToThisComOffset, bool disableParentCollision=false)
btVector3 m_basePos
void * m_userObjectPointer
void setLinearDamping(btScalar damp)
const char * m_baseName
bool hasSelfCollision() const
void setUserIndex2(int index)
void setBaseVel(const btVector3 &vel)
btMatrix3x3 m_cachedInertiaLowerRight
void setBaseOmega(const btVector3 &omega)
void addBaseTorque(const btVector3 &t)
void useGlobalVelocities(bool use)
btMultiBodyLinkCollider * getLinkCollider(int index)
int getNumLinks() const
btScalar m_baseMass
void setupFixed(int linkIndex, btScalar mass, const btVector3 &inertia, int parent, const btQuaternion &rotParentToThis, const btVector3 &parentComToThisPivotOffset, const btVector3 &thisPivotToThisComOffset, bool deprecatedDisableParentCollision=true)
bool m_hasSelfCollision
BT_DECLARE_ALIGNED_ALLOCATOR()
btAlignedObjectArray< btScalar > m_realBuf
btVector3 m_baseConstraintTorque
void operator=(const btMultiBody &)
void setBaseName(const char *name)
memory of setBaseName needs to be manager by user
const btMultibodyLink & getLink(int index) const
btVector3 getBaseOmega() const
void solveImatrix(const btVector3 &rhs_top, const btVector3 &rhs_bot, btScalar result[6]) const
bool getCanSleep() const
void stepVelocitiesMultiDof(btScalar dt, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m, bool isConstraintPass=false)
stepVelocitiesMultiDof is deprecated, use computeAccelerationsArticulatedBodyAlgorithmMultiDof instea...
int getNumDofs() const
void setBasePos(const btVector3 &pos)
const btVector3 & getBaseTorque() const
bool m_useGlobalVelocities
bool isUsingGlobalVelocities() const
btMatrix3x3 m_cachedInertiaLowerLeft
void setupRevolute(int linkIndex, btScalar mass, const btVector3 &inertia, int parentIndex, const btQuaternion &rotParentToThis, const btVector3 &jointAxis, const btVector3 &parentComToThisPivotOffset, const btVector3 &thisPivotToThisComOffset, bool disableParentCollision=false)
void * getUserPointer() const
users can point to their objects, userPointer is not used by Bullet
btVector3 m_baseTorque
void setAngularDamping(btScalar damp)
const char * getBaseName() const
btScalar m_linearDamping
int getUserIndex() const
bool hasFixedBase() const
const btVector3 & getBaseForce() const
void setUserPointer(void *userPointer)
users can point to their objects, userPointer is not used by Bullet
void processDeltaVeeMultiDof2()
void setPosUpdated(bool updated)
btScalar getMaxAppliedImpulse() const
btMatrix3x3 m_cachedInertiaTopLeft
bool isUsingRK4Integration() const
bool m_cachedInertiaValid
const btMultiBodyLinkCollider * getBaseCollider() const
void setupPlanar(int i, btScalar mass, const btVector3 &inertia, int parent, const btQuaternion &rotParentToThis, const btVector3 &rotationAxis, const btVector3 &parentComToThisComOffset, bool disableParentCollision=false)
bool internalNeedsJointFeedback() const
void setNumLinks(int numLinks)
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
btTransform getBaseWorldTransform() const
btScalar getLinearDamping() const
btScalar m_sleepTimer
btMatrix3x3 m_cachedInertiaTopRight
btScalar getBaseMass() const
btScalar getMaxCoordinateVelocity() const
btAlignedObjectArray< btScalar > m_deltaV
int getNumPosVars() const
void updateLinksDofOffsets()
void addBaseConstraintTorque(const btVector3 &t)
bool isPosUpdated() const
bool m_internalNeedsJointFeedback
the m_needsJointFeedback gets updated/computed during the stepVelocitiesMultiDof and it for internal ...
const btVector3 & getBaseInertia() const
const btQuaternion & getWorldToBaseRot() const
btVector3 m_baseConstraintForce
void setWorldToBaseRot(const btQuaternion &rot)
void setCompanionId(int id)
btMultiBody(const btMultiBody &)
btMultibodyLink & getLink(int index)
btMultiBodyLinkCollider * getBaseCollider()
void applyDeltaVeeMultiDof(const btScalar *delta_vee, btScalar multiplier)
const btVector3 getBaseVel() const
void addBaseForce(const btVector3 &f)
void applyDeltaVeeMultiDof2(const btScalar *delta_vee, btScalar multiplier)
btMultiBody(int n_links, btScalar mass, const btVector3 &inertia, bool fixedBase, bool canSleep, bool deprecatedMultiDof=true)
void setUserIndex(int index)
users can point to their objects, userPointer is not used by Bullet
const btScalar * getVelocityVector() const
void setBaseCollider(btMultiBodyLinkCollider *collider)
void setBaseWorldTransform(const btTransform &tr)
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
btQuaternion inverse() const
Return the inverse of this quaternion.
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition btTransform.h:34
void setRotation(const btQuaternion &q)
Set the rotational element by btQuaternion.
btQuaternion getRotation() const
Return a quaternion representing the rotation.
btVector3 & getOrigin()
Return the origin vector translation.
void setOrigin(const btVector3 &origin)
Set the translational element.
btVector3 can be used to represent 3D points and vectors.
Definition btVector3.h:84
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformDoubleData m_baseWorldTransform
btVector3DoubleData m_baseInertia
btCollisionObjectDoubleData * m_baseCollider
btMultiBodyLinkDoubleData * m_links
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btCollisionObjectFloatData * m_baseCollider
btVector3FloatData m_baseInertia
btMultiBodyLinkFloatData * m_links
btTransformFloatData m_baseWorldTransform
btQuaternionDoubleData m_zeroRotParentToThis
btCollisionObjectDoubleData * m_linkCollider
btVector3DoubleData m_jointAxisBottom[6]
btVector3DoubleData m_thisPivotToThisComOffset
btVector3DoubleData m_parentComToThisComOffset
btVector3DoubleData m_jointAxisTop[6]
btVector3DoubleData m_linkInertia
btCollisionObjectFloatData * m_linkCollider
btQuaternionFloatData m_zeroRotParentToThis
btVector3FloatData m_jointAxisBottom[6]
btVector3FloatData m_linkInertia
btVector3FloatData m_thisPivotToThisComOffset
btVector3FloatData m_jointAxisTop[6]
btVector3FloatData m_parentComToThisComOffset
These spatial algebra classes are used for btMultiBody, see BulletDynamics/Featherstone.
for serialization