mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
feat: Wowee Open Model format (.wom) — novel M2 replacement
WOM format: binary model file with no Blizzard structures. - WOM1 magic header + vertex/index counts + bounding box - Vertices: position(vec3) + normal(vec3) + texCoord(vec2) = 32 bytes - Indices: uint32 triangle list - Texture paths: PNG references (not BLP) WoweeModelLoader: - load(): reads .wom binary back to WoweeModel struct - save(): writes WoweeModel to .wom binary - fromM2(): converts existing M2 models to WOM (static geometry, strips bone/animation data, converts BLP paths to PNG) - exists(): checks for .wom file Format replacement progress — 5 out of 6 done: - DONE: ADT → WOT/WHM (terrain) - DONE: WDT → zone.json (map definition) - DONE: BLP → PNG (textures) - DONE: DBC → JSON (data tables) - DONE: M2 → WOM (static models) - TODO: WMO → open building format
This commit is contained in:
parent
176115f279
commit
b4cb833108
3 changed files with 210 additions and 0 deletions
46
include/pipeline/wowee_model.hpp
Normal file
46
include/pipeline/wowee_model.hpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace wowee {
|
||||
namespace pipeline {
|
||||
|
||||
// Wowee Open Model format (.wom) — novel format, no Blizzard IP
|
||||
// Designed for static doodads, props, and simple animated objects
|
||||
struct WoweeModel {
|
||||
struct Vertex {
|
||||
glm::vec3 position;
|
||||
glm::vec3 normal;
|
||||
glm::vec2 texCoord;
|
||||
};
|
||||
|
||||
std::string name;
|
||||
std::vector<Vertex> vertices;
|
||||
std::vector<uint32_t> indices;
|
||||
std::vector<std::string> texturePaths; // PNG paths
|
||||
float boundRadius = 1.0f;
|
||||
glm::vec3 boundMin{0}, boundMax{0};
|
||||
|
||||
bool isValid() const { return !vertices.empty() && !indices.empty(); }
|
||||
};
|
||||
|
||||
class WoweeModelLoader {
|
||||
public:
|
||||
// Load from .wom file (binary) + .wom.json (metadata)
|
||||
static WoweeModel load(const std::string& basePath);
|
||||
|
||||
// Save to .wom + .wom.json
|
||||
static bool save(const WoweeModel& model, const std::string& basePath);
|
||||
|
||||
// Convert an M2 model to WoweeModel (static geometry only, no animation)
|
||||
static WoweeModel fromM2(const std::string& m2Path, class AssetManager* am);
|
||||
|
||||
// Check if a .wom exists
|
||||
static bool exists(const std::string& basePath);
|
||||
};
|
||||
|
||||
} // namespace pipeline
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue