mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
feat: WOC collision mesh format — 7th novel open format
New format: WOC (Wowee Open Collision) — binary collision mesh for custom zone walkability. Magic WOC1 (0x31434F57). - WoweeCollisionBuilder::fromTerrain() generates collision triangles from terrain heightmap with slope classification (50 deg threshold) - Per-triangle flags: walkable (0x01), water (0x02), steep (0x04) - Respects terrain holes (skips triangles in hole regions) - Binary save/load with bounds, tile coords, triangle data - Auto-exported on zone save alongside WOT/WHM/WOM/WOB - Added to content pack validation (score now 0-7) - FORMAT_SPEC.md v1.1 updated with WOC binary layout - 19 new test assertions: flat terrain generation (32k tris all walkable), save/load round-trip, hole skipping - 328 total assertions across 84 test cases
This commit is contained in:
parent
961d863f82
commit
4d5eef480e
10 changed files with 342 additions and 7 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include "dbc_exporter.hpp"
|
||||
#include "pipeline/wowee_model.hpp"
|
||||
#include "pipeline/wowee_building.hpp"
|
||||
#include "pipeline/wowee_collision.hpp"
|
||||
#include "pipeline/wmo_loader.hpp"
|
||||
#include "core/coordinates.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
|
@ -956,6 +957,11 @@ void EditorApp::exportZone(const std::string& outputDir) {
|
|||
std::to_string(loadedTileX_) + "_" + std::to_string(loadedTileY_);
|
||||
WoweeTerrain::exportOpen(terrain_, openBase, loadedTileX_, loadedTileY_);
|
||||
WoweeTerrain::exportNormalMap(terrain_, openBase + "_normals.png");
|
||||
|
||||
// Export collision mesh (.woc)
|
||||
auto collision = pipeline::WoweeCollisionBuilder::fromTerrain(terrain_);
|
||||
if (collision.isValid())
|
||||
pipeline::WoweeCollisionBuilder::save(collision, openBase + ".woc");
|
||||
WoweeTerrain::exportAlphaMaps(terrain_, base + "/alphamaps");
|
||||
WoweeTerrain::exportWaterMask(terrain_, openBase + "_watermask.png");
|
||||
WoweeTerrain::exportHoleMask(terrain_, openBase + "_holemask.png");
|
||||
|
|
@ -1059,11 +1065,11 @@ void EditorApp::exportZone(const std::string& outputDir) {
|
|||
if (objectPlacer_.objectCount() > 0) summary += ", " + std::to_string(objectPlacer_.objectCount()) + " obj";
|
||||
if (npcSpawner_.spawnCount() > 0) summary += ", " + std::to_string(npcSpawner_.spawnCount()) + " NPC";
|
||||
if (questEditor_.questCount() > 0) summary += ", " + std::to_string(questEditor_.questCount()) + " quest";
|
||||
summary += " (score " + std::to_string(score) + "/6)";
|
||||
summary += " (score " + std::to_string(score) + "/7)";
|
||||
showToast(summary, 5.0f);
|
||||
LOG_INFO("=== Zone Export Summary ===");
|
||||
LOG_INFO(" Output: ", base);
|
||||
LOG_INFO(" Open format score: ", score, "/6");
|
||||
LOG_INFO(" Open format score: ", score, "/7");
|
||||
LOG_INFO(" Formats: ", validation.summary());
|
||||
LOG_INFO(" Terrain: WOT/WHM + heightmap/normals PNG");
|
||||
LOG_INFO(" Textures: ", usedTextures.size(), " BLP→PNG");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue