1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-18 13:12:50 +00:00
OpenMW/apps/openmw/mwphysics/ptrholder.hpp
2021-08-08 15:05:07 +02:00

40 lines
724 B
C++

#ifndef OPENMW_MWPHYSICS_PTRHOLDER_H
#define OPENMW_MWPHYSICS_PTRHOLDER_H
#include <mutex>
#include <memory>
#include <BulletCollision/CollisionDispatch/btCollisionObject.h>
#include "../mwworld/ptr.hpp"
namespace MWPhysics
{
class PtrHolder
{
public:
virtual ~PtrHolder() = default;
void updatePtr(const MWWorld::Ptr& updated)
{
mPtr = updated;
}
MWWorld::Ptr getPtr()
{
return mPtr;
}
btCollisionObject* getCollisionObject() const
{
return mCollisionObject.get();
}
protected:
MWWorld::Ptr mPtr;
std::unique_ptr<btCollisionObject> mCollisionObject;
};
}
#endif