Bullet Collision Detection & Physics Library: btCollisionObjectWrapper.h Source File

Bullet Collision Detection & Physics Library

btCollisionObjectWrapper.h
Go to the documentation of this file.
1 #ifndef BT_COLLISION_OBJECT_WRAPPER_H
2 #define BT_COLLISION_OBJECT_WRAPPER_H
3
6 class btCollisionShape;
7 class btCollisionObject;
8 class btTransform;
9 #include "LinearMath/btScalar.h" // for SIMD_FORCE_INLINE definition
10
11 #define BT_DECLARE_STACK_ONLY_OBJECT \
12 private: \
13 void* operator new(size_t size); \
14 void operator delete(void*);
15
16 struct btCollisionObjectWrapper;
17 struct btCollisionObjectWrapper
18 {
19 BT_DECLARE_STACK_ONLY_OBJECT
20
21 private:
22 btCollisionObjectWrapper(const btCollisionObjectWrapper&); // not implemented. Not allowed.
23 btCollisionObjectWrapper* operator=(const btCollisionObjectWrapper&);
24
25 public:
26 const btCollisionObjectWrapper* m_parent;
27 const btCollisionShape* m_shape;
28 const btCollisionObject* m_collisionObject;
29 const btTransform& m_worldTransform;
30 const btTransform* m_preTransform;
31 int m_partId;
32 int m_index;
33
34 btCollisionObjectWrapper(const btCollisionObjectWrapper* parent, const btCollisionShape* shape, const btCollisionObject* collisionObject, const btTransform& worldTransform, int partId, int index)
35 : m_parent(parent), m_shape(shape), m_collisionObject(collisionObject), m_worldTransform(worldTransform), m_preTransform(NULL), m_partId(partId), m_index(index)
36 {
37 }
38
39 btCollisionObjectWrapper(const btCollisionObjectWrapper* parent, const btCollisionShape* shape, const btCollisionObject* collisionObject, const btTransform& worldTransform, const btTransform& preTransform, int partId, int index)
40 : m_parent(parent), m_shape(shape), m_collisionObject(collisionObject), m_worldTransform(worldTransform), m_preTransform(&preTransform), m_partId(partId), m_index(index)
41 {
42 }
43
44 SIMD_FORCE_INLINE const btTransform& getWorldTransform() const { return m_worldTransform; }
45 SIMD_FORCE_INLINE const btCollisionObject* getCollisionObject() const { return m_collisionObject; }
46 SIMD_FORCE_INLINE const btCollisionShape* getCollisionShape() const { return m_shape; }
47 };
48
49 #endif //BT_COLLISION_OBJECT_WRAPPER_H
BT_DECLARE_STACK_ONLY_OBJECT
#define BT_DECLARE_STACK_ONLY_OBJECT
Definition: btCollisionObjectWrapper.h:11
btScalar.h
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition: btScalar.h:98
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:51
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:28
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:30
btCollisionObjectWrapper
Definition: btCollisionObjectWrapper.h:18
btCollisionObjectWrapper::getCollisionShape
const btCollisionShape * getCollisionShape() const
Definition: btCollisionObjectWrapper.h:46
btCollisionObjectWrapper::m_partId
int m_partId
Definition: btCollisionObjectWrapper.h:31
btCollisionObjectWrapper::btCollisionObjectWrapper
btCollisionObjectWrapper(const btCollisionObjectWrapper *parent, const btCollisionShape *shape, const btCollisionObject *collisionObject, const btTransform &worldTransform, const btTransform &preTransform, int partId, int index)
Definition: btCollisionObjectWrapper.h:39
btCollisionObjectWrapper::operator=
btCollisionObjectWrapper * operator=(const btCollisionObjectWrapper &)
btCollisionObjectWrapper::getCollisionObject
const btCollisionObject * getCollisionObject() const
Definition: btCollisionObjectWrapper.h:45
btCollisionObjectWrapper::m_preTransform
const btTransform * m_preTransform
Definition: btCollisionObjectWrapper.h:30
btCollisionObjectWrapper::m_worldTransform
const btTransform & m_worldTransform
Definition: btCollisionObjectWrapper.h:29
btCollisionObjectWrapper::btCollisionObjectWrapper
btCollisionObjectWrapper(const btCollisionObjectWrapper *parent, const btCollisionShape *shape, const btCollisionObject *collisionObject, const btTransform &worldTransform, int partId, int index)
Definition: btCollisionObjectWrapper.h:34
btCollisionObjectWrapper::m_collisionObject
const btCollisionObject * m_collisionObject
Definition: btCollisionObjectWrapper.h:28
btCollisionObjectWrapper::m_shape
const btCollisionShape * m_shape
Definition: btCollisionObjectWrapper.h:27
btCollisionObjectWrapper::getWorldTransform
const btTransform & getWorldTransform() const
Definition: btCollisionObjectWrapper.h:44
btCollisionObjectWrapper::m_parent
const btCollisionObjectWrapper * m_parent
Definition: btCollisionObjectWrapper.h:26
btCollisionObjectWrapper::btCollisionObjectWrapper
btCollisionObjectWrapper(const btCollisionObjectWrapper &)
btCollisionObjectWrapper::m_index
int m_index
Definition: btCollisionObjectWrapper.h:32