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 {
48 };
49 
50 
60 {
61 
67 
73 
76 
82 
83 
86 
87  //m_optionalMotionState allows to automatic synchronize the world transform for active objects
89 
90  //keep track of typed constraints referencing this rigid body
92 
94 
96 
97 
98 protected:
99 
106 
107 
108 public:
109 
110 
117  {
119 
124 
129 
137 
140 
141  //Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
142  //Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
148 
149  btRigidBodyConstructionInfo( btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0)):
150  m_mass(mass),
151  m_motionState(motionState),
152  m_collisionShape(collisionShape),
153  m_localInertia(localInertia),
156  m_friction(btScalar(0.5)),
158  m_restitution(btScalar(0.)),
161  m_additionalDamping(false),
166  {
168  }
169  };
170 
172  btRigidBody( const btRigidBodyConstructionInfo& constructionInfo);
173 
176  btRigidBody( btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0));
177 
178 
179  virtual ~btRigidBody()
180  {
181  //No constraints should point to this rigidbody
182  //Remove constraints from the dynamics world before you delete the related rigidbodies.
184  }
185 
186 protected:
187 
189  void setupRigidBody(const btRigidBodyConstructionInfo& constructionInfo);
190 
191 public:
192 
193  void proceedToTransform(const btTransform& newTrans);
194 
197  static const btRigidBody* upcast(const btCollisionObject* colObj)
198  {
200  return (const btRigidBody*)colObj;
201  return 0;
202  }
204  {
206  return (btRigidBody*)colObj;
207  return 0;
208  }
209 
211  void predictIntegratedTransform(btScalar step, btTransform& predictedTransform) ;
212 
213  void saveKinematicState(btScalar step);
214 
215  void applyGravity();
216 
217  void setGravity(const btVector3& acceleration);
218 
219  const btVector3& getGravity() const
220  {
221  return m_gravity_acceleration;
222  }
223 
224  void setDamping(btScalar lin_damping, btScalar ang_damping);
225 
227  {
228  return m_linearDamping;
229  }
230 
232  {
233  return m_angularDamping;
234  }
235 
237  {
239  }
240 
242  {
244  }
245 
246  void applyDamping(btScalar timeStep);
247 
249  return m_collisionShape;
250  }
251 
253  return m_collisionShape;
254  }
255 
256  void setMassProps(btScalar mass, const btVector3& inertia);
257 
258  const btVector3& getLinearFactor() const
259  {
260  return m_linearFactor;
261  }
262  void setLinearFactor(const btVector3& linearFactor)
263  {
264  m_linearFactor = linearFactor;
266  }
267  btScalar getInvMass() const { return m_inverseMass; }
269  return m_invInertiaTensorWorld;
270  }
271 
272  void integrateVelocities(btScalar step);
273 
274  void setCenterOfMassTransform(const btTransform& xform);
275 
276  void applyCentralForce(const btVector3& force)
277  {
278  m_totalForce += force*m_linearFactor;
279  }
280 
281  const btVector3& getTotalForce() const
282  {
283  return m_totalForce;
284  };
285 
286  const btVector3& getTotalTorque() const
287  {
288  return m_totalTorque;
289  };
290 
292  {
293  return m_invInertiaLocal;
294  };
295 
296  void setInvInertiaDiagLocal(const btVector3& diagInvInertia)
297  {
298  m_invInertiaLocal = diagInvInertia;
299  }
300 
302  {
303  m_linearSleepingThreshold = linear;
304  m_angularSleepingThreshold = angular;
305  }
306 
307  void applyTorque(const btVector3& torque)
308  {
309  m_totalTorque += torque*m_angularFactor;
310  }
311 
312  void applyForce(const btVector3& force, const btVector3& rel_pos)
313  {
314  applyCentralForce(force);
315  applyTorque(rel_pos.cross(force*m_linearFactor));
316  }
317 
318  void applyCentralImpulse(const btVector3& impulse)
319  {
321  }
322 
323  void applyTorqueImpulse(const btVector3& torque)
324  {
326  }
327 
328  void applyImpulse(const btVector3& impulse, const btVector3& rel_pos)
329  {
330  if (m_inverseMass != btScalar(0.))
331  {
332  applyCentralImpulse(impulse);
333  if (m_angularFactor)
334  {
335  applyTorqueImpulse(rel_pos.cross(impulse*m_linearFactor));
336  }
337  }
338  }
339 
340  void clearForces()
341  {
342  m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
343  m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
344  }
345 
346  void updateInertiaTensor();
347 
349  return m_worldTransform.getOrigin();
350  }
352 
354  return m_worldTransform;
355  }
356  const btVector3& getLinearVelocity() const {
357  return m_linearVelocity;
358  }
359  const btVector3& getAngularVelocity() const {
360  return m_angularVelocity;
361  }
362 
363 
364  inline void setLinearVelocity(const btVector3& lin_vel)
365  {
367  m_linearVelocity = lin_vel;
368  }
369 
370  inline void setAngularVelocity(const btVector3& ang_vel)
371  {
373  m_angularVelocity = ang_vel;
374  }
375 
377  {
378  //we also calculate lin/ang velocity for kinematic objects
379  return m_linearVelocity + m_angularVelocity.cross(rel_pos);
380 
381  //for kinematic objects, we could also use use:
382  // return (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
383  }
384 
385  void translate(const btVector3& v)
386  {
387  m_worldTransform.getOrigin() += v;
388  }
389 
390 
391  void getAabb(btVector3& aabbMin,btVector3& aabbMax) const;
392 
393 
394 
395 
396 
398  {
399  btVector3 r0 = pos - getCenterOfMassPosition();
400 
401  btVector3 c0 = (r0).cross(normal);
402 
403  btVector3 vec = (c0 * getInvInertiaTensorWorld()).cross(r0);
404 
405  return m_inverseMass + normal.dot(vec);
406 
407  }
408 
410  {
411  btVector3 vec = axis * getInvInertiaTensorWorld();
412  return axis.dot(vec);
413  }
414 
416  {
418  return;
419 
422  {
423  m_deactivationTime += timeStep;
424  } else
425  {
428  }
429 
430  }
431 
433  {
434 
436  return false;
437 
438  //disable deactivation
440  return false;
441 
443  return true;
444 
446  {
447  return true;
448  }
449  return false;
450  }
451 
452 
453 
455  {
456  return m_broadphaseHandle;
457  }
459  {
460  return m_broadphaseHandle;
461  }
463  {
464  m_broadphaseHandle = broadphaseProxy;
465  }
466 
467  //btMotionState allows to automatic synchronize the world transform for active objects
469  {
470  return m_optionalMotionState;
471  }
473  {
474  return m_optionalMotionState;
475  }
476  void setMotionState(btMotionState* motionState)
477  {
478  m_optionalMotionState = motionState;
480  motionState->getWorldTransform(m_worldTransform);
481  }
482 
483  //for experimental overriding of friction/contact solver func
486 
487  void setAngularFactor(const btVector3& angFac)
488  {
490  m_angularFactor = angFac;
491  }
492 
494  {
496  m_angularFactor.setValue(angFac,angFac,angFac);
497  }
499  {
500  return m_angularFactor;
501  }
502 
503  //is this rigidbody added to a btCollisionWorld/btDynamicsWorld/btBroadphase?
504  bool isInWorld() const
505  {
506  return (getBroadphaseProxy() != 0);
507  }
508 
509  virtual bool checkCollideWithOverride(const btCollisionObject* co) const;
510 
513 
515  {
516  return m_constraintRefs[index];
517  }
518 
520  {
521  return m_constraintRefs.size();
522  }
523 
524  void setFlags(int flags)
525  {
526  m_rigidbodyFlags = flags;
527  }
528 
529  int getFlags() const
530  {
531  return m_rigidbodyFlags;
532  }
533 
534  btVector3 computeGyroscopicForce(btScalar maxGyroscopicForce) const;
535 
537 
538  virtual int calculateSerializeBufferSize() const;
539 
541  virtual const char* serialize(void* dataBuffer, class btSerializer* serializer) const;
542 
543  virtual void serializeSingleObject(class btSerializer* serializer) const;
544 
545 };
546 
547 //@todo add m_optionalMotionState and m_constraintRefs to btRigidBodyData
550 {
572 };
573 
576 {
598  char m_padding[4];
599 };
600 
601 
602 
603 #endif //BT_RIGIDBODY_H
604 
btScalar getInvMass() const
Definition: btRigidBody.h:267
const btCollisionShape * getCollisionShape() const
Definition: btRigidBody.h:248
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:197
void getAabb(btVector3 &aabbMin, btVector3 &aabbMax) const
btVector3FloatData m_gravity
Definition: btRigidBody.h:557
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
for serialization
Definition: btMatrix3x3.h:1321
bool isInWorld() const
Definition: btRigidBody.h:504
void translate(const btVector3 &v)
Definition: btRigidBody.h:385
const btMotionState * getMotionState() const
Definition: btRigidBody.h:472
void applyGravity()
btVector3 m_totalTorque
Definition: btRigidBody.h:72
const btVector3 & getTotalForce() const
Definition: btRigidBody.h:281
int m_contactSolverType
Definition: btRigidBody.h:484
btScalar computeAngularImpulseDenominator(const btVector3 &axis) const
Definition: btRigidBody.h:409
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
Definition: btVector3.h:640
void applyTorqueImpulse(const btVector3 &torque)
Definition: btRigidBody.h:323
btVector3FloatData m_angularFactor
Definition: btRigidBody.h:555
void predictIntegratedTransform(btScalar step, btTransform &predictedTransform)
continuous collision detection needs prediction
const btVector3 & getAngularFactor() const
Definition: btRigidBody.h:498
void updateInertiaTensor()
btVector3 m_totalForce
Definition: btRigidBody.h:71
btScalar m_angularDamping
Definition: btRigidBody.h:75
btVector3FloatData m_angularVelocity
Definition: btRigidBody.h:554
bool gDisableDeactivation
Definition: btRigidBody.cpp:26
int getInternalType() const
reserved for Bullet internal usage
bool wantsSleeping()
Definition: btRigidBody.h:432
btVector3DoubleData m_totalForce
Definition: btRigidBody.h:586
btVector3 m_turnVelocity
Definition: btRigidBody.h:105
btBroadphaseProxy * getBroadphaseProxy()
Definition: btRigidBody.h:458
void setIdentity()
Set this transformation to the identity.
Definition: btTransform.h:172
#define btAssert(x)
Definition: btScalar.h:101
btVector3 m_gravity
Definition: btRigidBody.h:68
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
float m_additionalAngularDampingThresholdSqr
Definition: btRigidBody.h:567
const btVector3 & getTotalTorque() const
Definition: btRigidBody.h:286
btVector3DoubleData m_gravity
Definition: btRigidBody.h:583
#define SIMD_FORCE_INLINE
Definition: btScalar.h:58
btScalar computeImpulseDenominator(const btVector3 &pos, const btVector3 &normal) const
Definition: btRigidBody.h:397
btVector3 computeGyroscopicForce(btScalar maxGyroscopicForce) const
double m_additionalDampingFactor
Definition: btRigidBody.h:591
btScalar getLinearDamping() const
Definition: btRigidBody.h:226
btVector3DoubleData m_linearVelocity
Definition: btRigidBody.h:579
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:85
void setLinearFactor(const btVector3 &linearFactor)
Definition: btRigidBody.h:262
bool m_additionalDamping
Definition: btRigidBody.h:77
float m_linearSleepingThreshold
Definition: btRigidBody.h:569
btScalar m_additionalLinearDampingThresholdSqr
Definition: btRigidBody.h:79
int m_rigidbodyFlags
Definition: btRigidBody.h:93
void setSleepingThresholds(btScalar linear, btScalar angular)
Definition: btRigidBody.h:301
float m_additionalDampingFactor
Definition: btRigidBody.h:565
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:134
float m_additionalLinearDampingThresholdSqr
Definition: btRigidBody.h:566
btCollisionShape * m_collisionShape
btScalar dot(const btVector3 &v) const
Return the dot product.
Definition: btVector3.h:235
btVector3 m_pushVelocity
Definition: btRigidBody.h:104
btCollisionObjectFloatData m_collisionObjectData
Definition: btRigidBody.h:551
btVector3DoubleData m_linearFactor
Definition: btRigidBody.h:582
btVector3FloatData m_totalForce
Definition: btRigidBody.h:560
btVector3 getVelocityInLocalPoint(const btVector3 &rel_pos) const
Definition: btRigidBody.h:376
btScalar m_inverseMass
Definition: btRigidBody.h:65
void applyCentralForce(const btVector3 &force)
Definition: btRigidBody.h:276
void integrateVelocities(btScalar step)
void updateDeactivation(btScalar timeStep)
Definition: btRigidBody.h:415
virtual int calculateSerializeBufferSize() const
btVector3 m_invInertiaLocal
Definition: btRigidBody.h:70
int getNumConstraintRefs() const
Definition: btRigidBody.h:519
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
void setActivationState(int newState) const
double m_additionalAngularDampingFactor
Definition: btRigidBody.h:594
btVector3 m_deltaLinearVelocity
Definition: btRigidBody.h:100
void applyTorque(const btVector3 &torque)
Definition: btRigidBody.h:307
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:353
btScalar getAngularDamping() const
Definition: btRigidBody.h:231
btMatrix3x3DoubleData m_invInertiaTensorWorld
Definition: btRigidBody.h:578
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:575
void setFlags(int flags)
Definition: btRigidBody.h:524
void addConstraintRef(btTypedConstraint *c)
btScalar getAngularSleepingThreshold() const
Definition: btRigidBody.h:241
btQuaternion getOrientation() const
btCollisionShape * getCollisionShape()
Definition: btRigidBody.h:252
float m_additionalAngularDampingFactor
Definition: btRigidBody.h:568
btRigidBodyFlags
Definition: btRigidBody.h:41
const btVector3 & getAngularVelocity() const
Definition: btRigidBody.h:359
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:88
btScalar m_restitution
best simulation results using zero restitution.
Definition: btRigidBody.h:136
virtual bool checkCollideWithOverride(const btCollisionObject *co) const
btCollisionObject can be used to manage collision detection objects.
btScalar m_linearSleepingThreshold
Definition: btRigidBody.h:84
virtual void serializeSingleObject(class btSerializer *serializer) const
void setLinearVelocity(const btVector3 &lin_vel)
Definition: btRigidBody.h:364
const btVector3 & getCenterOfMassPosition() const
Definition: btRigidBody.h:348
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:59
btVector3 m_angularFactor
Definition: btRigidBody.h:102
void clearForces()
Definition: btRigidBody.h:340
btVector3DoubleData m_invInertiaLocal
Definition: btRigidBody.h:585
The btRigidBodyConstructionInfo structure provides information to create a rigid body.
Definition: btRigidBody.h:116
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:549
btVector3 m_angularVelocity
Definition: btRigidBody.h:64
btVector3DoubleData m_angularFactor
Definition: btRigidBody.h:581
void proceedToTransform(const btTransform &newTrans)
btScalar getLinearSleepingThreshold() const
Definition: btRigidBody.h:236
btScalar m_additionalDampingFactor
Definition: btRigidBody.h:78
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:74
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:149
btVector3 m_linearFactor
Definition: btRigidBody.h:66
btVector3 m_linearVelocity
Definition: btRigidBody.h:63
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:59
btVector3DoubleData m_angularVelocity
Definition: btRigidBody.h:580
void setAngularFactor(btScalar angFac)
Definition: btRigidBody.h:493
void applyForce(const btVector3 &force, const btVector3 &rel_pos)
Definition: btRigidBody.h:312
int m_debugBodyId
Definition: btRigidBody.h:95
btVector3FloatData m_totalTorque
Definition: btRigidBody.h:561
btMatrix3x3FloatData m_invInertiaTensorWorld
Definition: btRigidBody.h:552
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:514
void setMassProps(btScalar mass, const btVector3 &inertia)
double m_additionalAngularDampingThresholdSqr
Definition: btRigidBody.h:593
void applyDamping(btScalar timeStep)
applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping ...
const btVector3 & getGravity() const
Definition: btRigidBody.h:219
btCollisionObjectDoubleData m_collisionObjectData
Definition: btRigidBody.h:577
#define WANTS_DEACTIVATION
double m_linearSleepingThreshold
Definition: btRigidBody.h:595
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:370
void setInvInertiaDiagLocal(const btVector3 &diagInvInertia)
Definition: btRigidBody.h:296
btVector3DoubleData m_gravity_acceleration
Definition: btRigidBody.h:584
void setMotionState(btMotionState *motionState)
Definition: btRigidBody.h:476
static float4 cross(const float4 &a, const float4 &b)
btVector3FloatData m_linearVelocity
Definition: btRigidBody.h:553
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:268
void applyCentralImpulse(const btVector3 &impulse)
Definition: btRigidBody.h:318
const btBroadphaseProxy * getBroadphaseProxy() const
Definition: btRigidBody.h:454
btScalar m_additionalAngularDampingThresholdSqr
Definition: btRigidBody.h:80
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:291
btMotionState * getMotionState()
Definition: btRigidBody.h:468
const btVector3 & getLinearVelocity() const
Definition: btRigidBody.h:356
btVector3 m_gravity_acceleration
Definition: btRigidBody.h:69
btScalar m_additionalAngularDampingFactor
Definition: btRigidBody.h:81
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
Definition: btRigidBody.h:328
for serialization
Definition: btMatrix3x3.h:1327
btBroadphaseProxy * m_broadphaseHandle
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
Definition: btQuaternion.h:48
void setNewBroadphaseProxy(btBroadphaseProxy *broadphaseProxy)
Definition: btRigidBody.h:462
btVector3FloatData m_invInertiaLocal
Definition: btRigidBody.h:559
btVector3DoubleData m_totalTorque
Definition: btRigidBody.h:587
float m_angularSleepingThreshold
Definition: btRigidBody.h:570
virtual ~btRigidBody()
Definition: btRigidBody.h:179
btAlignedObjectArray< btTypedConstraint * > m_constraintRefs
Definition: btRigidBody.h:91
double m_angularSleepingThreshold
Definition: btRigidBody.h:596
int m_frictionSolverType
Definition: btRigidBody.h:485
void removeConstraintRef(btTypedConstraint *c)
const btVector3 & getLinearFactor() const
Definition: btRigidBody.h:258
btVector3 m_deltaAngularVelocity
Definition: btRigidBody.h:101
double m_additionalLinearDampingThresholdSqr
Definition: btRigidBody.h:592
void setAngularFactor(const btVector3 &angFac)
Definition: btRigidBody.h:487
static btRigidBody * upcast(btCollisionObject *colObj)
Definition: btRigidBody.h:203
int getActivationState() const
The BT_ENABLE_GYROPSCOPIC_FORCE can easily introduce instability So generally it is best to not enabl...
Definition: btRigidBody.h:47
btVector3FloatData m_gravity_acceleration
Definition: btRigidBody.h:558
btMotionState * m_motionState
When a motionState is provided, the rigid body will initialize its world transform from the motion st...
Definition: btRigidBody.h:122
btScalar m_friction
best simulation results when friction is non-zero
Definition: btRigidBody.h:131
btVector3 m_invMass
Definition: btRigidBody.h:103
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:266
int getFlags() const
Definition: btRigidBody.h:529
btVector3FloatData m_linearFactor
Definition: btRigidBody.h:556
btMatrix3x3 m_invInertiaTensorWorld
Definition: btRigidBody.h:62
void setGravity(const btVector3 &acceleration)