2017-08-01 14:30:58 +02:00
|
|
|
#ifndef BT_COLLISION_OBJECT_WRAPPER_H
|
|
|
|
#define BT_COLLISION_OBJECT_WRAPPER_H
|
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
///btCollisionObjectWrapperis an internal data structure.
|
2017-08-01 14:30:58 +02:00
|
|
|
///Most users can ignore this and use btCollisionObject and btCollisionShape instead
|
|
|
|
class btCollisionShape;
|
|
|
|
class btCollisionObject;
|
|
|
|
class btTransform;
|
2019-01-03 14:26:51 +01:00
|
|
|
#include "LinearMath/btScalar.h" // for SIMD_FORCE_INLINE definition
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
#define BT_DECLARE_STACK_ONLY_OBJECT \
|
2019-01-03 14:26:51 +01:00
|
|
|
private: \
|
|
|
|
void* operator new(size_t size); \
|
|
|
|
void operator delete(void*);
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
struct btCollisionObjectWrapper;
|
|
|
|
struct btCollisionObjectWrapper
|
|
|
|
{
|
2019-01-03 14:26:51 +01:00
|
|
|
BT_DECLARE_STACK_ONLY_OBJECT
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
private:
|
2019-01-03 14:26:51 +01:00
|
|
|
btCollisionObjectWrapper(const btCollisionObjectWrapper&); // not implemented. Not allowed.
|
2017-08-01 14:30:58 +02:00
|
|
|
btCollisionObjectWrapper* operator=(const btCollisionObjectWrapper&);
|
|
|
|
|
|
|
|
public:
|
|
|
|
const btCollisionObjectWrapper* m_parent;
|
|
|
|
const btCollisionShape* m_shape;
|
|
|
|
const btCollisionObject* m_collisionObject;
|
|
|
|
const btTransform& m_worldTransform;
|
2019-01-03 14:26:51 +01:00
|
|
|
int m_partId;
|
|
|
|
int m_index;
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
btCollisionObjectWrapper(const btCollisionObjectWrapper* parent, const btCollisionShape* shape, const btCollisionObject* collisionObject, const btTransform& worldTransform, int partId, int index)
|
2019-01-03 14:26:51 +01:00
|
|
|
: m_parent(parent), m_shape(shape), m_collisionObject(collisionObject), m_worldTransform(worldTransform), m_partId(partId), m_index(index)
|
|
|
|
{
|
|
|
|
}
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
SIMD_FORCE_INLINE const btTransform& getWorldTransform() const { return m_worldTransform; }
|
|
|
|
SIMD_FORCE_INLINE const btCollisionObject* getCollisionObject() const { return m_collisionObject; }
|
|
|
|
SIMD_FORCE_INLINE const btCollisionShape* getCollisionShape() const { return m_shape; }
|
|
|
|
};
|
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
#endif //BT_COLLISION_OBJECT_WRAPPER_H
|