From f18976ced9402dd79a23acc8a06bd5052166fa91 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 03:17:10 -0700 Subject: [PATCH] feat(editor): --info-woc CLI prints collision mesh metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completes the --info* CLI family. Reports tile coords, triangle count, walkable/steep classification breakdown, and world-space bounds — useful for verifying that collision exports cover the expected area. --- tools/editor/main.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/editor/main.cpp b/tools/editor/main.cpp index 9c5acf8f..4557c049 100644 --- a/tools/editor/main.cpp +++ b/tools/editor/main.cpp @@ -2,6 +2,7 @@ #include "content_pack.hpp" #include "pipeline/wowee_model.hpp" #include "pipeline/wowee_building.hpp" +#include "pipeline/wowee_collision.hpp" #include "pipeline/wmo_loader.hpp" #include "pipeline/asset_manager.hpp" #include "pipeline/custom_zone_discovery.hpp" @@ -21,6 +22,7 @@ static void printUsage(const char* argv0) { std::printf(" --validate Score zone open-format completeness and exit\n"); std::printf(" --info Print WOM file metadata (version, counts) and exit\n"); std::printf(" --info-wob Print WOB building metadata (groups, portals, doodads) and exit\n"); + std::printf(" --info-woc Print WOC collision metadata (triangle counts, bounds) and exit\n"); std::printf(" --version Show version and format info\n\n"); std::printf("Wowee World Editor v1.0.0 — by Kelsi Davis\n"); std::printf("Novel open formats: WOT/WHM/WOM/WOB/WOC/WCP + PNG/JSON\n"); @@ -86,6 +88,25 @@ int main(int argc, char* argv[]) { std::printf(" total tris : %zu\n", totalIdx / 3); std::printf(" total mats : %zu (across all groups)\n", totalMats); return 0; + } else if (std::strcmp(argv[i], "--info-woc") == 0 && i + 1 < argc) { + std::string path = argv[++i]; + if (path.size() < 4 || path.substr(path.size() - 4) != ".woc") + path += ".woc"; + auto col = wowee::pipeline::WoweeCollisionBuilder::load(path); + if (!col.isValid()) { + std::fprintf(stderr, "WOC not found or invalid: %s\n", path.c_str()); + return 1; + } + std::printf("WOC: %s\n", path.c_str()); + std::printf(" tile : (%u, %u)\n", col.tileX, col.tileY); + std::printf(" triangles : %zu\n", col.triangles.size()); + std::printf(" walkable : %zu\n", col.walkableCount()); + std::printf(" steep : %zu\n", col.steepCount()); + std::printf(" bounds.min : (%.1f, %.1f, %.1f)\n", + col.bounds.min.x, col.bounds.min.y, col.bounds.min.z); + std::printf(" bounds.max : (%.1f, %.1f, %.1f)\n", + col.bounds.max.x, col.bounds.max.y, col.bounds.max.z); + return 0; } else if (std::strcmp(argv[i], "--validate") == 0 && i + 1 < argc) { std::string zoneDir = argv[++i]; auto v = wowee::editor::ContentPacker::validateZone(zoneDir);