1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 19:19:55 +00:00
openmw-tes3mp/apps/openmw/mwphysics/heightfield.hpp
2021-08-04 13:16:31 +02:00

53 lines
1.3 KiB
C++

#ifndef OPENMW_MWPHYSICS_HEIGHTFIELD_H
#define OPENMW_MWPHYSICS_HEIGHTFIELD_H
#include <osg/ref_ptr>
#include <osg/Object>
#include <LinearMath/btScalar.h>
#include <memory>
#include <vector>
class btCollisionObject;
class btHeightfieldTerrainShape;
namespace osg
{
class Object;
}
namespace MWPhysics
{
class PhysicsTaskScheduler;
class HeightField : public osg::Object
{
public:
HeightField(const float* heights, int x, int y, float triSize, float sqrtVerts, float minH, float maxH, const osg::Object* holdObject, PhysicsTaskScheduler* scheduler);
~HeightField();
META_Object(MWPhysics, HeightField)
btCollisionObject* getCollisionObject();
const btCollisionObject* getCollisionObject() const;
const btHeightfieldTerrainShape* getShape() const;
private:
std::unique_ptr<btHeightfieldTerrainShape> mShape;
std::unique_ptr<btCollisionObject> mCollisionObject;
osg::ref_ptr<const osg::Object> mHoldObject;
#if BT_BULLET_VERSION < 310
std::vector<btScalar> mHeights;
#endif
PhysicsTaskScheduler* mTaskScheduler;
HeightField();
HeightField(const HeightField&, const osg::CopyOp&);
void operator=(const HeightField&);
HeightField(const HeightField&);
};
}
#endif