#pragma once #include #include #include #include namespace wowee { namespace pipeline { // Wowee Open Building format (.wob) — novel WMO replacement // Buildings with multiple groups, portals, and doodad sets struct WoweeBuilding { struct Vertex { glm::vec3 position; glm::vec3 normal; glm::vec2 texCoord; glm::vec4 color; // vertex color/lighting }; struct Material { std::string texturePath; uint32_t flags = 0; uint32_t shader = 0; uint32_t blendMode = 0; }; struct Group { std::string name; std::vector vertices; std::vector indices; std::vector texturePaths; std::vector materials; glm::vec3 boundMin{0}, boundMax{0}; bool isOutdoor = false; }; struct Portal { int groupA = -1, groupB = -1; std::vector vertices; // portal polygon }; struct DoodadPlacement { std::string modelPath; // .wom path glm::vec3 position; glm::vec3 rotation; float scale = 1.0f; }; std::string name; std::vector groups; std::vector portals; std::vector doodads; float boundRadius = 1.0f; bool isValid() const { return !groups.empty(); } }; class WoweeBuildingLoader { public: static WoweeBuilding load(const std::string& basePath); static bool save(const WoweeBuilding& building, const std::string& basePath); static bool exists(const std::string& basePath); // Convert WOB to WMOModel for the client's WMO renderer static bool toWMOModel(const WoweeBuilding& building, class WMOModel& outModel); // Convert WMOModel to WOB (for editor export) static WoweeBuilding fromWMO(const class WMOModel& wmo, const std::string& name = ""); // Convenience: try loading .wob from the standard editor // search paths (custom_zones/buildings/, output/buildings/). `extraPrefixes` // are tried before the defaults — pass per-zone roots like // {"output//buildings/", "custom_zones//buildings/"} when the // caller knows the active zone. Returns valid building on hit. static WoweeBuilding tryLoadByGamePath( const std::string& gamePath, const std::vector& extraPrefixes = {}); }; } // namespace pipeline } // namespace wowee