Blender  V3.3
btDefaultMotionState.h
Go to the documentation of this file.
1 #ifndef BT_DEFAULT_MOTION_STATE_H
2 #define BT_DEFAULT_MOTION_STATE_H
3 
4 #include "btMotionState.h"
5 
9 {
10  btTransform m_graphicsWorldTrans;
14 
16 
18  : m_graphicsWorldTrans(startTrans),
19  m_centerOfMassOffset(centerOfMassOffset),
20  m_startWorldTrans(startTrans),
21  m_userPointer(0)
22 
23  {
24  }
25 
27  virtual void getWorldTransform(btTransform & centerOfMassWorldTrans) const
28  {
29  centerOfMassWorldTrans = m_graphicsWorldTrans * m_centerOfMassOffset.inverse();
30  }
31 
34  virtual void setWorldTransform(const btTransform& centerOfMassWorldTrans)
35  {
36  m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset;
37  }
38 };
39 
40 #endif //BT_DEFAULT_MOTION_STATE_H
BT_DECLARE_ALIGNED_ALLOCATOR()
virtual void getWorldTransform(btTransform &centerOfMassWorldTrans) const
synchronizes world transform from user to physics
btTransform m_startWorldTrans
virtual void setWorldTransform(const btTransform &centerOfMassWorldTrans)
btTransform m_centerOfMassOffset
btDefaultMotionState(const btTransform &startTrans=btTransform::getIdentity(), const btTransform &centerOfMassOffset=btTransform::getIdentity())
void * m_userPointer
static const btMatrix3x3 & getIdentity()
Definition: btMatrix3x3.h:350
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:285
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:30