refactor(editor): extract vertex weld into shared cli_weld utility

Three callers were each open-coding the same quantize-and-
bucket pass over vertex positions: --info-mesh-stats,
--info-wob-stats, and --bake-wom-collision. Move the
implementation to cli_weld.{hpp,cpp} as buildWeldMap() and
have each caller pass a flat positions array.

Identical std::map-based exact-equality keying preserved
(unbalanced-hash collisions remain absent). All three call
sites verified to produce byte-identical output:

  • info-mesh-stats firepit: 240→80 verts, 0 boundary
  • info-wob-stats cube:     8→8 verts, watertight YES
  • bake-wom-collision tent: 18→6 verts, 8-tri WOC

About 75 lines of duplication removed; future weld-using
commands now opt in by including one header.
This commit is contained in:
Kelsi 2026-05-09 11:05:54 -07:00
parent 9031bdb620
commit 869124fa96
6 changed files with 107 additions and 76 deletions

View file

@ -1363,6 +1363,7 @@ add_executable(wowee_editor
tools/editor/cli_zone_export.cpp
tools/editor/cli_arg_required.cpp
tools/editor/cli_multi_arg_required.cpp
tools/editor/cli_weld.cpp
tools/editor/cli_dispatch.cpp
tools/editor/editor_app.cpp
tools/editor/editor_camera.cpp