#pragma once #include "BVHConstructor.hpp" #include #include #include #include #include #include namespace parser { // TODO: make generic Builder class for this and MeshBuilder? class GameObjectBVHBuilder { private: const std::filesystem::path m_dataPath; BVHConstructor m_bvhConstructor; const size_t m_workers; std::unordered_map m_doodads; std::unordered_map m_wmos; std::unordered_map m_serialized; std::vector m_threads; mutable std::mutex m_mutex; std::atomic_bool m_shutdownRequested; void Work(); public: GameObjectBVHBuilder(const std::filesystem::path& dataPath, const std::filesystem::path& outputPath, size_t workers); ~GameObjectBVHBuilder(); void Begin(); size_t Shutdown(); size_t Remaining() const { std::lock_guard guard(m_mutex); return m_doodads.size() + m_wmos.size(); } }; } // namespace parser