Bullet Collision Detection & Physics Library
btRigidBody.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_RIGIDBODY_H
17 #define BT_RIGIDBODY_H
18 
20 #include "LinearMath/btTransform.h"
23 
24 class btCollisionShape;
25 class btMotionState;
26 class btTypedConstraint;
27 
28 
30 extern bool gDisableDeactivation;
31 
32 #ifdef BT_USE_DOUBLE_PRECISION
33 #define btRigidBodyData btRigidBodyDoubleData
34 #define btRigidBodyDataName "btRigidBodyDoubleData"
35 #else
36 #define btRigidBodyData btRigidBodyFloatData
37 #define btRigidBodyDataName "btRigidBodyFloatData"
38 #endif //BT_USE_DOUBLE_PRECISION
39 
40 
42 {
51 };
52 
53 
63 {
64 
70 
76 
79 
85 
86 
89 
90  //m_optionalMotionState allows to automatic synchronize the world transform for active objects
92 
93  //keep track of typed constraints referencing this rigid body, to disable collision between linked bodies
95 
97 
99 
100 
101 protected:
102 
109 
110 
111 public:
112 
113 
120  {
122 
127 
132 
140 
143 
144  //Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
145  //Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
151 
152  btRigidBodyConstructionInfo( btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0)):
153  m_mass(mass),
154  m_motionState(motionState),
155  m_collisionShape(collisionShape),
156  m_localInertia(localInertia),
157  m_linearDamping(btScalar(0.)),
158  m_angularDamping(btScalar(0.)),
159  m_friction(btScalar(0.5)),
160  m_rollingFriction(btScalar(0)),
161  m_restitution(btScalar(0.)),
162  m_linearSleepingThreshold(btScalar(0.8)),
163  m_angularSleepingThreshold(btScalar(1.f)),
164  m_additionalDamping(false),
165  m_additionalDampingFactor(btScalar(0.005)),
166  m_additionalLinearDampingThresholdSqr(btScalar(0.01)),
167  m_additionalAngularDampingThresholdSqr(btScalar(0.01)),
168  m_additionalAngularDampingFactor(btScalar(0.01))
169  {
170  m_startWorldTransform.setIdentity();
171  }
172  };
173 
175  btRigidBody( const btRigidBodyConstructionInfo& constructionInfo);
176 
179  btRigidBody( btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0));
180 
181 
182  virtual ~btRigidBody()
183  {
184  //No constraints should point to this rigidbody
185  //Remove constraints from the dynamics world before you delete the related rigidbodies.
186  btAssert(m_constraintRefs.size()==0);
187  }
188 
189 protected:
190 
192  void setupRigidBody(const btRigidBodyConstructionInfo& constructionInfo);
193 
194 public:
195 
196  void proceedToTransform(const btTransform& newTrans);
197 
200  static const btRigidBody* upcast(const btCollisionObject* colObj)
201  {
203  return (const btRigidBody*)colObj;
204  return 0;
205  }
207  {
209  return (btRigidBody*)colObj;
210  return 0;
211  }
212 
214  void predictIntegratedTransform(btScalar step, btTransform& predictedTransform) ;
215 
216  void saveKinematicState(btScalar step);
217 
218  void applyGravity();
219 
220  void setGravity(const btVector3& acceleration);
221 
222  const btVector3& getGravity() const
223  {
224  return m_gravity_acceleration;
225  }
226 
227  void setDamping(btScalar lin_damping, btScalar ang_damping);
228 
230  {
231  return m_linearDamping;
232  }
233 
235  {
236  return m_angularDamping;
237  }
238 
240  {
242  }
243 
245  {
247  }
248 
249  void applyDamping(btScalar timeStep);
250 
252  return m_collisionShape;
253  }
254 
256  return m_collisionShape;
257  }
258 
259  void setMassProps(btScalar mass, const btVector3& inertia);
260 
261  const btVector3& getLinearFactor() const
262  {
263  return m_linearFactor;
264  }
265  void setLinearFactor(const btVector3& linearFactor)
266  {
267  m_linearFactor = linearFactor;
268  m_invMass = m_linearFactor*m_inverseMass;
269  }
270  btScalar getInvMass() const { return m_inverseMass; }
272  return m_invInertiaTensorWorld;
273  }
274 
275  void integrateVelocities(btScalar step);
276 
277  void setCenterOfMassTransform(const btTransform& xform);
278 
279  void applyCentralForce(const btVector3& force)
280  {
281  m_totalForce += force*m_linearFactor;
282  }
283 
284  const btVector3& getTotalForce() const
285  {
286  return m_totalForce;
287  };
288 
289  const btVector3& getTotalTorque() const
290  {
291  return m_totalTorque;
292  };
293 
295  {
296  return m_invInertiaLocal;
297  };
298 
299  void setInvInertiaDiagLocal(const btVector3& diagInvInertia)
300  {
301  m_invInertiaLocal = diagInvInertia;
302  }
303 
305  {
306  m_linearSleepingThreshold = linear;
307  m_angularSleepingThreshold = angular;
308  }
309 
310  void applyTorque(const btVector3& torque)
311  {
312  m_totalTorque += torque*m_angularFactor;
313  }
314 
315  void applyForce(const btVector3& force, const btVector3& rel_pos)
316  {
317  applyCentralForce(force);
318  applyTorque(rel_pos.cross(force*m_linearFactor));
319  }
320 
321  void applyCentralImpulse(const btVector3& impulse)
322  {
323  m_linearVelocity += impulse *m_linearFactor * m_inverseMass;
324  }
325 
326  void applyTorqueImpulse(const btVector3& torque)
327  {
328  m_angularVelocity += m_invInertiaTensorWorld * torque * m_angularFactor;
329  }
330 
331  void applyImpulse(const btVector3& impulse, const btVector3& rel_pos)
332  {
333  if (m_inverseMass != btScalar(0.))
334  {
335  applyCentralImpulse(impulse);
336  if (m_angularFactor)
337  {
338  applyTorqueImpulse(rel_pos.cross(impulse*m_linearFactor));
339  }
340  }
341  }
342 
343  void clearForces()
344  {
345  m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
346  m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
347  }
348 
349  void updateInertiaTensor();
350 
352  return m_worldTransform.getOrigin();
353  }
355 
357  return m_worldTransform;
358  }
359  const btVector3& getLinearVelocity() const {
360  return m_linearVelocity;
361  }
362  const btVector3& getAngularVelocity() const {
363  return m_angularVelocity;
364  }
365 
366 
367  inline void setLinearVelocity(const btVector3& lin_vel)
368  {
370  m_linearVelocity = lin_vel;
371  }
372 
373  inline void setAngularVelocity(const btVector3& ang_vel)
374  {
376  m_angularVelocity = ang_vel;
377  }
378 
380  {
381  //we also calculate lin/ang velocity for kinematic objects
382  return m_linearVelocity + m_angularVelocity.cross(rel_pos);
383 
384  //for kinematic objects, we could also use use:
385  // return (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
386  }
387 
388  void translate(const btVector3& v)
389  {
390  m_worldTransform.getOrigin() += v;
391  }
392 
393 
394  void getAabb(btVector3& aabbMin,btVector3& aabbMax) const;
395 
396 
397 
398 
399 
401  {
402  btVector3 r0 = pos - getCenterOfMassPosition();
403 
404  btVector3 c0 = (r0).cross(normal);
405 
406  btVector3 vec = (c0 * getInvInertiaTensorWorld()).cross(r0);
407 
408  return m_inverseMass + normal.dot(vec);
409 
410  }
411 
413  {
414  btVector3 vec = axis * getInvInertiaTensorWorld();
415  return axis.dot(vec);
416  }
417 
419  {
421  return;
422 
423  if ((getLinearVelocity().length2() < m_linearSleepingThreshold*m_linearSleepingThreshold) &&
424  (getAngularVelocity().length2() < m_angularSleepingThreshold*m_angularSleepingThreshold))
425  {
426  m_deactivationTime += timeStep;
427  } else
428  {
431  }
432 
433  }
434 
436  {
437 
439  return false;
440 
441  //disable deactivation
443  return false;
444 
446  return true;
447 
449  {
450  return true;
451  }
452  return false;
453  }
454 
455 
456 
458  {
459  return m_broadphaseHandle;
460  }
462  {
463  return m_broadphaseHandle;
464  }
466  {
467  m_broadphaseHandle = broadphaseProxy;
468  }
469 
470  //btMotionState allows to automatic synchronize the world transform for active objects
472  {
473  return m_optionalMotionState;
474  }
476  {
477  return m_optionalMotionState;
478  }
479  void setMotionState(btMotionState* motionState)
480  {
481  m_optionalMotionState = motionState;
482  if (m_optionalMotionState)
483  motionState->getWorldTransform(m_worldTransform);
484  }
485 
486  //for experimental overriding of friction/contact solver func
489 
490  void setAngularFactor(const btVector3& angFac)
491  {
493  m_angularFactor = angFac;
494  }
495 
497  {
499  m_angularFactor.setValue(angFac,angFac,angFac);
500  }
502  {
503  return m_angularFactor;
504  }
505 
506  //is this rigidbody added to a btCollisionWorld/btDynamicsWorld/btBroadphase?
507  bool isInWorld() const
508  {
509  return (getBroadphaseProxy() != 0);
510  }
511 
514 
516  {
517  return m_constraintRefs[index];
518  }
519 
521  {
522  return m_constraintRefs.size();
523  }
524 
525  void setFlags(int flags)
526  {
527  m_rigidbodyFlags = flags;
528  }
529 
530  int getFlags() const
531  {
532  return m_rigidbodyFlags;
533  }
534 
535 
536 
537 
540 
543 
545  btVector3 computeGyroscopicForceExplicit(btScalar maxGyroscopicForce) const;
546  btVector3 getLocalInertia() const;
547 
549 
550  virtual int calculateSerializeBufferSize() const;
551 
553  virtual const char* serialize(void* dataBuffer, class btSerializer* serializer) const;
554 
555  virtual void serializeSingleObject(class btSerializer* serializer) const;
556 
557 };
558 
559 //@todo add m_optionalMotionState and m_constraintRefs to btRigidBodyData
562 {
584 };
585 
588 {
610  char m_padding[4];
611 };
612 
613 
614 
615 #endif //BT_RIGIDBODY_H
616 
btScalar getInvMass() const
Definition: btRigidBody.h:270
const btCollisionShape * getCollisionShape() const
Definition: btRigidBody.h:251
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody ...
Definition: btRigidBody.h:200
void getAabb(btVector3 &aabbMin, btVector3 &aabbMax) const
btVector3FloatData m_gravity
Definition: btRigidBody.h:569
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
for serialization
Definition: btMatrix3x3.h:1342
bool isInWorld() const
Definition: btRigidBody.h:507
void translate(const btVector3 &v)
Definition: btRigidBody.h:388
const btMotionState * getMotionState() const
Definition: btRigidBody.h:475
void applyGravity()
btVector3 m_totalTorque
Definition: btRigidBody.h:75
const btVector3 & getTotalForce() const
Definition: btRigidBody.h:284
int m_contactSolverType
Definition: btRigidBody.h:487
btScalar computeAngularImpulseDenominator(const btVector3 &axis) const
Definition: btRigidBody.h:412
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
Definition: btVector3.h:640
void applyTorqueImpulse(const btVector3 &torque)
Definition: btRigidBody.h:326
btVector3FloatData m_angularFactor
Definition: btRigidBody.h:567
void predictIntegratedTransform(btScalar step, btTransform &predictedTransform)
continuous collision detection needs prediction
const btVector3 & getAngularFactor() const
Definition: btRigidBody.h:501
void updateInertiaTensor()
btVector3 m_totalForce
Definition: btRigidBody.h:74
btScalar m_angularDamping
Definition: btRigidBody.h:78
btVector3FloatData m_angularVelocity
Definition: btRigidBody.h:566
bool gDisableDeactivation
Definition: btRigidBody.cpp:26
btVector3 computeGyroscopicImpulseImplicit_World(btScalar dt) const
perform implicit force computation in world space
int getInternalType() const
reserved for Bullet internal usage
bool wantsSleeping()
Definition: btRigidBody.h:435
btVector3DoubleData m_totalForce
Definition: btRigidBody.h:598
btVector3 m_turnVelocity
Definition: btRigidBody.h:108
btBroadphaseProxy * getBroadphaseProxy()
Definition: btRigidBody.h:461
void setIdentity()
Set this transformation to the identity.
Definition: btTransform.h:172
#define btAssert(x)
Definition: btScalar.h:113
btVector3 m_gravity
Definition: btRigidBody.h:71
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
float m_additionalAngularDampingThresholdSqr
Definition: btRigidBody.h:579
const btVector3 & getTotalTorque() const
Definition: btRigidBody.h:289
btVector3DoubleData m_gravity
Definition: btRigidBody.h:595
#define SIMD_FORCE_INLINE
Definition: btScalar.h:63
btScalar computeImpulseDenominator(const btVector3 &pos, const btVector3 &normal) const
Definition: btRigidBody.h:400
double m_additionalDampingFactor
Definition: btRigidBody.h:603
btScalar getLinearDamping() const
Definition: btRigidBody.h:229
btVector3DoubleData m_linearVelocity
Definition: btRigidBody.h:591
btRigidBody(const btRigidBodyConstructionInfo &constructionInfo)
btRigidBody constructor using construction info
Definition: btRigidBody.cpp:30
void setDamping(btScalar lin_damping, btScalar ang_damping)
btScalar m_angularSleepingThreshold
Definition: btRigidBody.h:88
void setLinearFactor(const btVector3 &linearFactor)
Definition: btRigidBody.h:265
bool m_additionalDamping
Definition: btRigidBody.h:80
float m_linearSleepingThreshold
Definition: btRigidBody.h:581
btScalar m_additionalLinearDampingThresholdSqr
Definition: btRigidBody.h:82
int m_rigidbodyFlags
Definition: btRigidBody.h:96
void setSleepingThresholds(btScalar linear, btScalar angular)
Definition: btRigidBody.h:304
float m_additionalDampingFactor
Definition: btRigidBody.h:577
btTransform m_worldTransform
#define ISLAND_SLEEPING
btScalar m_rollingFriction
the m_rollingFriction prevents rounded shapes, such as spheres, cylinders and capsules from rolling f...
Definition: btRigidBody.h:137
float m_additionalLinearDampingThresholdSqr
Definition: btRigidBody.h:578
btCollisionShape * m_collisionShape
btScalar dot(const btVector3 &v) const
Return the dot product.
Definition: btVector3.h:235
btVector3 m_pushVelocity
Definition: btRigidBody.h:107
btCollisionObjectFloatData m_collisionObjectData
Definition: btRigidBody.h:563
btVector3DoubleData m_linearFactor
Definition: btRigidBody.h:594
btVector3FloatData m_totalForce
Definition: btRigidBody.h:572
btVector3 getVelocityInLocalPoint(const btVector3 &rel_pos) const
Definition: btRigidBody.h:379
btScalar m_inverseMass
Definition: btRigidBody.h:68
void applyCentralForce(const btVector3 &force)
Definition: btRigidBody.h:279
BT_ENABLE_GYROPSCOPIC_FORCE flags is enabled by default in Bullet 2.83 and onwards.
Definition: btRigidBody.h:47
void integrateVelocities(btScalar step)
void updateDeactivation(btScalar timeStep)
Definition: btRigidBody.h:418
virtual int calculateSerializeBufferSize() const
btVector3 m_invInertiaLocal
Definition: btRigidBody.h:73
int getNumConstraintRefs() const
Definition: btRigidBody.h:520
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
void setActivationState(int newState) const
btVector3 computeGyroscopicForceExplicit(btScalar maxGyroscopicForce) const
explicit version is best avoided, it gains energy
double m_additionalAngularDampingFactor
Definition: btRigidBody.h:606
btVector3 m_deltaLinearVelocity
Definition: btRigidBody.h:103
void applyTorque(const btVector3 &torque)
Definition: btRigidBody.h:310
btScalar gDeactivationTime
Definition: btRigidBody.cpp:25
int size() const
return the number of elements in the array
btVector3 & getOrigin()
Return the origin vector translation.
Definition: btTransform.h:117
void setupRigidBody(const btRigidBodyConstructionInfo &constructionInfo)
setupRigidBody is only used internally by the constructor
Definition: btRigidBody.cpp:41
const btTransform & getCenterOfMassTransform() const
Definition: btRigidBody.h:356
btScalar getAngularDamping() const
Definition: btRigidBody.h:234
btMatrix3x3DoubleData m_invInertiaTensorWorld
Definition: btRigidBody.h:590
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:587
void setFlags(int flags)
Definition: btRigidBody.h:525
void addConstraintRef(btTypedConstraint *c)
btScalar getAngularSleepingThreshold() const
Definition: btRigidBody.h:244
btQuaternion getOrientation() const
btCollisionShape * getCollisionShape()
Definition: btRigidBody.h:255
float m_additionalAngularDampingFactor
Definition: btRigidBody.h:580
btRigidBodyFlags
Definition: btRigidBody.h:41
const btVector3 & getAngularVelocity() const
Definition: btRigidBody.h:362
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
Definition: btVector3.h:377
btMotionState * m_optionalMotionState
Definition: btRigidBody.h:91
btScalar m_restitution
best simulation results using zero restitution.
Definition: btRigidBody.h:139
btCollisionObject can be used to manage collision detection objects.
btScalar m_linearSleepingThreshold
Definition: btRigidBody.h:87
virtual void serializeSingleObject(class btSerializer *serializer) const
void setLinearVelocity(const btVector3 &lin_vel)
Definition: btRigidBody.h:367
const btVector3 & getCenterOfMassPosition() const
Definition: btRigidBody.h:351
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:62
btVector3 m_angularFactor
Definition: btRigidBody.h:105
void clearForces()
Definition: btRigidBody.h:343
btVector3DoubleData m_invInertiaLocal
Definition: btRigidBody.h:597
The btRigidBodyConstructionInfo structure provides information to create a rigid body.
Definition: btRigidBody.h:119
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:561
btVector3 m_angularVelocity
Definition: btRigidBody.h:67
btVector3DoubleData m_angularFactor
Definition: btRigidBody.h:593
void proceedToTransform(const btTransform &newTrans)
btScalar getLinearSleepingThreshold() const
Definition: btRigidBody.h:239
btScalar m_additionalDampingFactor
Definition: btRigidBody.h:81
int m_updateRevision
internal update revision number. It will be increased when the object changes. This allows some subsy...
btScalar m_linearDamping
Definition: btRigidBody.h:77
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
btRigidBodyConstructionInfo(btScalar mass, btMotionState *motionState, btCollisionShape *collisionShape, const btVector3 &localInertia=btVector3(0, 0, 0))
Definition: btRigidBody.h:152
btVector3 m_linearFactor
Definition: btRigidBody.h:69
btVector3 m_linearVelocity
Definition: btRigidBody.h:66
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:64
btVector3 getLocalInertia() const
btVector3DoubleData m_angularVelocity
Definition: btRigidBody.h:592
void setAngularFactor(btScalar angFac)
Definition: btRigidBody.h:496
void applyForce(const btVector3 &force, const btVector3 &rel_pos)
Definition: btRigidBody.h:315
int m_debugBodyId
Definition: btRigidBody.h:98
btVector3FloatData m_totalTorque
Definition: btRigidBody.h:573
btMatrix3x3FloatData m_invInertiaTensorWorld
Definition: btRigidBody.h:564
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
void setCenterOfMassTransform(const btTransform &xform)
btTypedConstraint * getConstraintRef(int index)
Definition: btRigidBody.h:515
void setMassProps(btScalar mass, const btVector3 &inertia)
double m_additionalAngularDampingThresholdSqr
Definition: btRigidBody.h:605
void applyDamping(btScalar timeStep)
applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping ...
const btVector3 & getGravity() const
Definition: btRigidBody.h:222
btCollisionObjectDoubleData m_collisionObjectData
Definition: btRigidBody.h:589
#define WANTS_DEACTIVATION
double m_linearSleepingThreshold
Definition: btRigidBody.h:607
TypedConstraint is the baseclass for Bullet constraints and vehicles.
The btMotionState interface class allows the dynamics world to synchronize and interpolate the update...
Definition: btMotionState.h:23
void saveKinematicState(btScalar step)
void setAngularVelocity(const btVector3 &ang_vel)
Definition: btRigidBody.h:373
void setInvInertiaDiagLocal(const btVector3 &diagInvInertia)
Definition: btRigidBody.h:299
btVector3DoubleData m_gravity_acceleration
Definition: btRigidBody.h:596
void setMotionState(btMotionState *motionState)
Definition: btRigidBody.h:479
btVector3FloatData m_linearVelocity
Definition: btRigidBody.h:565
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
#define DISABLE_DEACTIVATION
const btMatrix3x3 & getInvInertiaTensorWorld() const
Definition: btRigidBody.h:271
void applyCentralImpulse(const btVector3 &impulse)
Definition: btRigidBody.h:321
const btBroadphaseProxy * getBroadphaseProxy() const
Definition: btRigidBody.h:457
btScalar m_additionalAngularDampingThresholdSqr
Definition: btRigidBody.h:83
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
Definition: btMatrix3x3.h:48
const btVector3 & getInvInertiaDiagLocal() const
Definition: btRigidBody.h:294
btMotionState * getMotionState()
Definition: btRigidBody.h:471
const btVector3 & getLinearVelocity() const
Definition: btRigidBody.h:359
btVector3 m_gravity_acceleration
Definition: btRigidBody.h:72
btScalar m_additionalAngularDampingFactor
Definition: btRigidBody.h:84
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
Definition: btRigidBody.h:331
for serialization
Definition: btMatrix3x3.h:1348
btBroadphaseProxy * m_broadphaseHandle
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
Definition: btQuaternion.h:55
void setNewBroadphaseProxy(btBroadphaseProxy *broadphaseProxy)
Definition: btRigidBody.h:465
btVector3FloatData m_invInertiaLocal
Definition: btRigidBody.h:571
btVector3DoubleData m_totalTorque
Definition: btRigidBody.h:599
float m_angularSleepingThreshold
Definition: btRigidBody.h:582
virtual ~btRigidBody()
Definition: btRigidBody.h:182
btVector3 computeGyroscopicImpulseImplicit_Body(btScalar step) const
perform implicit force computation in body space (inertial frame)
btAlignedObjectArray< btTypedConstraint * > m_constraintRefs
Definition: btRigidBody.h:94
double m_angularSleepingThreshold
Definition: btRigidBody.h:608
int m_frictionSolverType
Definition: btRigidBody.h:488
void removeConstraintRef(btTypedConstraint *c)
const btVector3 & getLinearFactor() const
Definition: btRigidBody.h:261
btVector3 m_deltaAngularVelocity
Definition: btRigidBody.h:104
double m_additionalLinearDampingThresholdSqr
Definition: btRigidBody.h:604
void setAngularFactor(const btVector3 &angFac)
Definition: btRigidBody.h:490
static btRigidBody * upcast(btCollisionObject *colObj)
Definition: btRigidBody.h:206
int getActivationState() const
btVector3FloatData m_gravity_acceleration
Definition: btRigidBody.h:570
btMotionState * m_motionState
When a motionState is provided, the rigid body will initialize its world transform from the motion st...
Definition: btRigidBody.h:125
btScalar m_friction
best simulation results when friction is non-zero
Definition: btRigidBody.h:134
btVector3 m_invMass
Definition: btRigidBody.h:106
virtual void getWorldTransform(btTransform &worldTrans) const =0
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:278
int getFlags() const
Definition: btRigidBody.h:530
btVector3FloatData m_linearFactor
Definition: btRigidBody.h:568
btMatrix3x3 m_invInertiaTensorWorld
Definition: btRigidBody.h:65
void setGravity(const btVector3 &acceleration)