Kelsidavis-WoWee/include/pipeline/wowee_building.hpp
Kelsi 01d3638835 feat: WOB→WMO conversion and loading in client terrain manager
- WoweeBuildingLoader::toWMOModel() converts WOB groups to WMOModel
  with vertices, indices, normals, texCoords, and vertex colors
- TerrainManager now loads WOB files from custom_zones/buildings/
  and converts to WMOModel for the WMO renderer pipeline
- WMOGroup indices converted from uint32 to uint16 for renderer compat

Client open format support — 4 of 6 now loading:
- FULL: WOT/WHM terrain, PNG textures, WOM models
- LOAD: WOB buildings (converts to WMOModel, render pipeline TODO)
- DETECT: zone.json (scanned), JSON DBC (scanned)
2026-05-05 12:12:26 -07:00

62 lines
1.6 KiB
C++

#pragma once
#include <glm/glm.hpp>
#include <string>
#include <vector>
#include <cstdint>
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 Group {
std::string name;
std::vector<Vertex> vertices;
std::vector<uint32_t> indices;
std::vector<std::string> texturePaths;
glm::vec3 boundMin{0}, boundMax{0};
bool isOutdoor = false;
};
struct Portal {
int groupA = -1, groupB = -1;
std::vector<glm::vec3> 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<Group> groups;
std::vector<Portal> portals;
std::vector<DoodadPlacement> 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);
};
} // namespace pipeline
} // namespace wowee