#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHOBJECT_H #define OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHOBJECT_H #include "areatype.hpp" #include #include #include #include #include class btCollisionShape; class btCompoundShape; namespace DetourNavigator { class CollisionShape { public: CollisionShape(osg::ref_ptr instance, const btCollisionShape& shape) : mShapeInstance(std::move(instance)) , mShape(shape) {} const osg::ref_ptr& getShapeInstance() const { return mShapeInstance; } const btCollisionShape& getShape() const { return mShape; } private: osg::ref_ptr mShapeInstance; std::reference_wrapper mShape; }; class RecastMeshObject { public: RecastMeshObject(const CollisionShape& shape, const btTransform& transform, const AreaType areaType); bool update(const btTransform& transform, const AreaType areaType); const btCollisionShape& getShape() const { return mShape; } const btTransform& getTransform() const { return mTransform; } AreaType getAreaType() const { return mAreaType; } private: osg::ref_ptr mShapeInstance; std::reference_wrapper mShape; btTransform mTransform; AreaType mAreaType; btVector3 mLocalScaling; std::vector mChildren; }; } #endif