#ifndef OPENMW_COMPONENTS_ESMPAGING_CHUNKMANAGER_H #define OPENMW_COMPONENTS_ESMPAGING_CHUNKMANAGER_H #include #include #include #include namespace Resource { class SceneManager; } namespace MWWorld { class ESMStore; } namespace MWRender { typedef std::tuple ChunkId; // Center, Size class ObjectPaging : public Resource::GenericResourceManager, public Terrain::QuadTreeWorld::ChunkManager { public: ObjectPaging(Resource::SceneManager* sceneManager); ~ObjectPaging() = default; osg::ref_ptr getChunk(float size, const osg::Vec2f& center, unsigned char lod, unsigned int lodFlags, bool far, const osg::Vec3f& viewPoint, bool compile) override; osg::ref_ptr createChunk(float size, const osg::Vec2f& center, const osg::Vec3f& viewPoint, bool compile); virtual void setExpiryDelay(double expiryDelay) override { mExpiryDelay = 0.5f; } virtual unsigned int getNodeMask() override; void enableObject(const ESM::RefNum & refnum, bool enabled); void clear(); private: Resource::SceneManager* mSceneManager; float mMergeFactor; float mMinSize; OpenThreads::Mutex mDisabledMutex; std::set mDisabled; }; } #endif