### WCAnalyzer Full Example with All Options Source: https://github.com/akspa0/parp-tools/blob/main/WCA/WCAnalyzer/WCAnalyzer.CLI/README.md Complete example demonstrating WCAnalyzer usage with all available command-line options including input directory, output directory, listfile for validation, and verbose logging. ```bash dotnet run --project WCAnalyzer.CLI -- --directory "./wow/adt/files" --output "./analysis" --listfile "./listfile.csv" ``` -------------------------------- ### GET /api/builds/{product}/latest Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/migration-plan/todo.md Gets a singular latest version for a specific product. Allows targeting of specific WoW product versions. ```APIDOC ## GET /api/builds/{product}/latest ### Description Gets a singular latest version for a specific product ### Method GET ### Endpoint https://wago.tools/api/builds/{product}/latest ### Parameters #### Path Parameters - **product** (string) - Required - WoW product identifier (e.g., wow_retail, wow_classic_beta) ### Request Example ```bash GET https://wago.tools/api/builds/wow_retail/latest ``` ### Response #### Success Response (200) Returns latest build version for the specified product #### Response Example "10.1.0.50000" ``` -------------------------------- ### DBCTool CLI Example Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/DBCTool/docs/001-areaid-mapping.md Example CLI command for running DBCTool to compare areas and export remap.json. Includes input directories for Alpha and LK DBFilesClient. ```bash dotnet run -- --dbd-dir lib/WoWDBDefs/definitions --out dbctool_outputs --compare-area --input 0.5.3=.../DBFilesClient --input 3.3.5=.../DBFilesClient --export-remap dbctool_outputs/alpha053_to_335_remap.json --allow-do-not-use ``` -------------------------------- ### GET /api/builds Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/migration-plan/todo.md Lists every version available for the API. Returns comprehensive build information across all products. ```APIDOC ## GET /api/builds ### Description Lists every version available for the API ### Method GET ### Endpoint https://wago.tools/api/builds ### Parameters No parameters required ### Request Example ```bash GET https://wago.tools/api/builds ``` ### Response #### Success Response (200) Returns array of build objects with version and product information #### Response Example { "builds": [ { "product": "wow_retail", "version": "10.1.0.50000" } ] } ``` -------------------------------- ### Project Setup: Adding Source References (C#) Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/next/docs/plan.md Adds source references to the Warcraft.NET and wow.tools.local DBCD projects within a .NET solution. This is a high-level implementation step for setting up the project structure. ```csharp Add source references to: - next/libs/Warcraft.NET/Warcraft.NET/Warcraft.NET.csproj - next/libs/wow.tools.local/DBCD/DBCD/DBCD.csproj ``` -------------------------------- ### CLI usage instructions update Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/docs/BuildingLevelExporter_Plan.md Updated command-line interface usage string showing available PM4Rebuilder commands including the new export-buildings functionality. Provides clear usage examples for all commands. ```text PM4Rebuilder Commands: export-subcomponents [outDir] - Export all sub-components as individual OBJ files export-buildings [outDir] - Export complete buildings as unified OBJ files analyze-building-groups [outDir] - Analyze building aggregation patterns ``` -------------------------------- ### GET /api/builds/latest Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/migration-plan/todo.md Lists the latest version for each available product. Useful for getting current build information across all supported products. ```APIDOC ## GET /api/builds/latest ### Description Lists the latest version for each available product ### Method GET ### Endpoint https://wago.tools/api/builds/latest ### Parameters No parameters required ### Request Example ```bash GET https://wago.tools/api/builds/latest ``` ### Response #### Success Response (200) Returns latest build information for each product #### Response Example { "wow_retail": "10.1.0.50000", "wow_classic": "3.4.2.50000" } ``` -------------------------------- ### Setup dependencies and clone required libraries using PowerShell Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/AlphaWDTAnalysisTool/README.md Creates the lib folder and clones the required wow.tools.local and WoWDBDefs repositories. Ensure the lib directory exists before cloning. The commands use PowerShell's mkdir and git clone with submodule support. ```PowerShell # Ensure lib folder exists mkdir lib -Force | Out-Null # Clone wow.tools.local with submodules git clone --recurse-submodules https://github.com/Marlamin/wow.tools.local.git lib/wow.tools.local # Clone WoWDBDefs git clone https://github.com/wowdev/WoWDBDefs.git lib/WoWDBDefs ``` -------------------------------- ### OpenGL Rendering Example (MCVT) Source: https://github.com/akspa0/parp-tools/blob/main/PM4Tool/docs/wowdev.wiki/ADT_v18.md Provides an OpenGL example demonstrating how to render the MCVT terrain grid, using triangle strips to combine outer and inner vertices for detailed rendering. ```OpenGL gl.glBegin(GL.GL_TRIANGLE_STRIP); ``` -------------------------------- ### C# - Export Strategy Classes Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/memory-bank/pm4-exporter-refactor-plan.md This C# code provides example implementations of export strategies, demonstrating Spatial and Hierarchical approaches. ```csharp public class SpatialExportStrategy : IExportStrategy { } public class HierarchicalExportStrategy : IExportStrategy { } ``` -------------------------------- ### Apply ADT to WDL transformation preset Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/next/docs/cli.md Example showing how to apply a preset transformation for aligning ADT files with WDL coordinates. Includes server-origin subtraction and axis flipping for proper alignment between different coordinate systems. ```bash dotnet run --project next/src/GillijimProject.Next.Cli -- obj-xform \ --in "C:/proj/adt/dev_0_0.obj" \ --out-dir ./out/aligned/adt \ --preset adt-to-wdl --flip-x ``` -------------------------------- ### Restore Dependencies (.NET) Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/README.md This snippet shows how to restore the project dependencies using the .NET CLI. This command fetches and installs all necessary packages defined in the project file. ```bash dotnet restore src/WoWToolbox.sln ``` -------------------------------- ### Debug Logging Example Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/src/PM4Rebuilder/README.md Sample debug log output showing internal processing data like surface references, vertex usage, and warnings for over-aggregation. ```text [DIAGNOSTIC] Building 0: MSLK entry references surface 5 [DIAGNOSTIC] Building 0: Surface 5 ('G40AA0A7E') has 943 faces [DIAGNOSTIC] Building 0 data sources: - Surface groups used: [5, 12, 8, 15] - Vertex pool usage: regular=1200, mscn=400 [CROSS-CONTAMINATION WARNING] Building 0 uses 12 surface groups - may be over-aggregating! ``` -------------------------------- ### JSON Example: options Object Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/DBCTool/docs/api.md Illustrates the 'options' object which contains boolean flags that control the behavior of the matching algorithm. The example shows the 'disallow_do_not_use_targets' flag. ```json { "options": { "disallow_do_not_use_targets": true } } ``` -------------------------------- ### Texture Transform Array Setup Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/docs/wowdev.wiki/M2.md Defines a texture transform array with unknown bytes and associated materials/particles. This structure appears to be used in CM2SceneRender::SetupTextureTransforms and is uploaded directly to shaders. ```cpp char unk[2]; // likely used in CM2SceneRender::SetupTextureTransforms and uploaded to the shader directly. 0 otherwise. } texture_ac[m2data.header.materials.count + m2data.header.particles.count]; ``` -------------------------------- ### JSON Example: aliases Object Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/DBCTool/docs/api.md Demonstrates the structure of the 'aliases' object used for mapping normalized area names to alternative names. This facilitates handling name variations between game builds. ```json { "aliases": { "demonic stronghold": [ "dreadmaul hold" ], "shadowfang": [ "shadowfang keep" ] } } ``` -------------------------------- ### OBJ File Format Example Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/src/PM4Rebuilder/README.md Shows the standard OBJ file format used for exporting buildings. Includes vertex and face definitions with comments indicating metadata like triangle count and ID. ```obj # PM4 Building Export - Building ID 0 # Triangle Count: 1097 # Triangle Range: ParentId 12345 v -32.826920 317.932159 12.033226 v -33.800953 316.848389 12.934059 # ... vertices ... f 1 2 3 f 4 5 6 # ... faces ... ``` -------------------------------- ### JSON Example: meta Object Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/DBCTool/docs/api.md Illustrates the structure of the 'meta' object within the .remap.json file. It contains metadata related to the file's generation, such as source and target build aliases and the generation timestamp. ```json { "meta": { "src_alias": "0.5.3", "src_build": "0.5.3.3368", "tgt_build": "3.3.5.12340", "generated_at": "2025-09-12T20:13:41.9670375Z" } } ``` -------------------------------- ### PM4WmoMatcher Tool Operational Modes Source: https://github.com/akspa0/parp-tools/blob/main/PM4Tool/memory-bank/activeContext.md Examples of using the PM4WmoMatcher command-line interface in its different operational modes. These include traditional mode for combined point clouds, MSLK objects mode for individual scene graph objects versus walkable surfaces (recommended), and preprocessing mode for batch analysis. ```bash # Traditional Mode: Combined point clouds (legacy) PM4WmoMatcher.exe --pm4 files/ --wmo wmo_assets/ ``` ```bash # MSLK Objects Mode: Individual scene graph objects vs walkable surfaces (recommended) PM4WmoMatcher.exe --pm4 files/ --wmo wmo_assets/ --use-mslk-objects --visualize ``` ```bash # Preprocessing Mode: Batch cache system for efficient repeated analysis # Two-phase: preprocess then analyze PM4WmoMatcher.exe --preprocess-wmo --wmo-dir input/wmo/ --cache-dir cache/ PM4WmoMatcher.exe --preprocess-pm4 --pm4-dir input/pm4/ --cache-dir cache/ PM4WmoMatcher.exe --analyze-cache --cache-dir cache/ --output results.csv ``` -------------------------------- ### Define Pm4Property Database Model in C# Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/docs/MPRR-Building-Boundaries.md Defines a C# class model for PM4 properties mapped to the database, including keys and navigation properties. Used in Entity Framework for ORM operations. Depends on EF Core annotations; inputs from database; outputs model instances. Supports nullable navigation; assumes standard entity setup. ```csharp public class Pm4Property { [Key] public int Id { get; set; } public int Pm4FileId { get; set; } public int GlobalIndex { get; set; } /// /// First ushort value. When Value1=65535, acts as sentinel marker. /// public ushort Value1 { get; set; } /// /// Second ushort value. When following a sentinel, identifies component type. /// public ushort Value2 { get; set; } /// /// True if this entry is a building boundary sentinel (Value1=65535). /// public bool IsBoundarySentinel { get; set; } // Navigation properties [ForeignKey(nameof(Pm4FileId))] public virtual Pm4File Pm4File { get; set; } = null!; } ``` -------------------------------- ### Assemble Building Geometry via SQL Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/docs/MPRR-Building-Boundaries.md The SQL query retrieves the vertex coordinates for all triangles belonging to a building range defined by MPRR sentinel properties. It joins the Properties, Links, Surfaces, Triangles, and Vertices tables, using start and end property indices and a file ID as parameters, and returns triangle indices together with the 3‑D coordinates of the three vertices. ```sql -- Get all triangles for a building range defined by MPRR sentinels SELECT t.VertexA, t.VertexB, t.VertexC, v1.X as V1_X, v1.Y as V1_Y, v1.Z as V1_Z, v2.X as V2_X, v2.Y as V2_Y, v2.Z as V2_Z, v3.X as V3_X, v3.Y as V3_Y, v3.Z as V3_Z FROM Properties p JOIN Links l ON (l.GlobalIndex BETWEEN @startPropertyIndex AND @endPropertyIndex) JOIN Surfaces s ON s.GlobalIndex = l.ReferenceIndex JOIN Triangles t ON (t.GlobalIndex BETWEEN s.MsviFirstIndex AND s.MsviFirstIndex + s.IndexCount - 1) JOIN Vertices v1 ON v1.GlobalIndex = t.VertexA JOIN Vertices v2 ON v1.GlobalIndex = t.VertexB JOIN Vertices v3 ON v1.GlobalIndex = t.VertexC WHERE p.Pm4FileId = @fileId; ``` -------------------------------- ### GET /api/files Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/migration-plan/todo.md Gets all files available in a specific version. Supports version and format parameters for customized output. ```APIDOC ## GET /api/files ### Description Gets all files available in a specific version. Supports version and format parameters. ### Method GET ### Endpoint https://wago.tools/api/files ### Parameters #### Query Parameters - **version** (string) - Optional - Specific build version (e.g., 10.1.0.50000) - **product** (string) - Optional - Product identifier (e.g., wow_classic_beta) - **format** (string) - Optional - Output format: csv or json (default: csv) ### Request Example ```bash GET https://wago.tools/api/files?version=10.1.0.50000&format=json ``` ### Response #### Success Response (200) Returns list of all available files in the specified version #### Response Example [ { "fdid": 123456, "filename": "example.m2", "type": "model" } ] ``` -------------------------------- ### Build and Run Instructions Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/src/PM4Rebuilder/README.md Instructions to build and run the PM4Rebuilder project using .NET 9. Navigate to the project directory and use dotnet CLI commands. ```bash # Navigate to project directory cd src/PM4Rebuilder # Build project dotnet build # Run with commands dotnet run -- [arguments] ``` -------------------------------- ### GET /api/info/{fdid} Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/migration-plan/todo.md Get information about a file based on FDID. Returns metadata and details about the specified file. ```APIDOC ## GET /api/info/{fdid} ### Description Get information about a file based on FDID ### Method GET ### Endpoint https://wago.tools/api/info/{fdid} ### Parameters #### Path Parameters - **fdid** (integer) - Required - File Data ID ### Request Example ```bash GET https://wago.tools/api/info/123456 ``` ### Response #### Success Response (200) Returns file metadata including size, checksum, and availability #### Response Example { "fdid": 123456, "filename": "example.m2", "size": 1024, "checksum": "abcdef123456" } ``` -------------------------------- ### GET /api/casc/{fdid} Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/migration-plan/todo.md Gets a CASC file based on the FDID. Supports version parameter for specific builds. ```APIDOC ## GET /api/casc/{fdid} ### Description Gets a CASC file based on the FDID. Supports version parameter for specific builds. ### Method GET ### Endpoint https://wago.tools/api/casc/{fdid} ### Parameters #### Path Parameters - **fdid** (integer) - Required - File Data ID #### Query Parameters - **version** (string) - Optional - Specific build version (e.g., 10.1.0.50000) - **product** (string) - Optional - Product identifier (e.g., wow_classic_beta) ### Request Example ```bash GET https://wago.tools/api/casc/123456?version=10.1.0.50000 ``` ### Response #### Success Response (200) Returns the requested CASC file #### Response Example Binary file content ``` -------------------------------- ### .NET Solution Build Commands via dotnet CLI Source: https://github.com/akspa0/parp-tools/blob/main/PM4Tool/memory-bank/techContext.md These bash commands facilitate building, testing, and cleaning the WoWToolbox solution using the .NET SDK. They require the .NET 9.0 runtime and access to the solution file at src/WoWToolbox.sln. Inputs are command-line arguments; outputs include build artifacts, test results, or cleaned directories with no specific limitations beyond standard .NET constraints. ```bash # Standard .NET 9.0 commands dotnet build src/WoWToolbox.sln # Build entire solution dotnet test src/WoWToolbox.sln # Run all tests dotnet clean src/WoWToolbox.sln # Clean build artifacts ``` -------------------------------- ### Build Solution (.NET) Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/README.md This snippet shows how to build the .NET solution using the .NET CLI. This command compiles the project's source code and generates executable files. ```bash dotnet build src/WoWToolbox.sln ``` -------------------------------- ### Build AlphaWDTAnalysisTool project with .NET CLI Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/AlphaWDTAnalysisTool/README.md Compiles the AlphaWDTAnalysisTool solution using the .NET SDK. Run this from the repository root after cloning dependencies. The built CLI assembly in the bin directory. ```PowerShell # From repository root dotnet build ``` -------------------------------- ### Build WCAnalyzer Project Source: https://github.com/akspa0/parp-tools/blob/main/WCA/WCAnalyzer/WCAnalyzer.CLI/README.md Command to build the WCAnalyzer project using .NET CLI. Compiles the C# source code and prepares the executable for use. ```bash dotnet build ``` -------------------------------- ### JSON Example: ignore_area_numbers Array Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/DBCTool/docs/api.md Shows an example of the 'ignore_area_numbers' array used to exclude specific Area IDs from the matching process. This is useful for test areas or unused entries. ```json { "ignore_area_numbers": [ 1310729, // Collin's Test 1310730 // Test ] } ``` -------------------------------- ### Run Tests (.NET) Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/README.md This snippet shows how to run the project's test suite using the .NET CLI. This command executes all tests defined in the project and reports the results. ```bash dotnet test test/WoWToolbox.Tests ``` ```bash dotnet test test/WoWToolbox.Tests --filter "LoadAndProcessPm4FilesInDirectory" ``` -------------------------------- ### Run All WoWToolbox Tests Source: https://github.com/akspa0/parp-tools/blob/main/PM4Tool/README.md Executes the entire test suite for the WoWToolbox project. This command is used to ensure all functionalities, including batch processing, individual analysis, special cases, and coordinate validation, are working correctly. ```bash dotnet test test/WoWToolbox.Tests ``` -------------------------------- ### JSON Example: explicit_map Array Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/DBCTool/docs/api.md Provides an example of the 'explicit_map' array, which defines direct mappings between source and target Area IDs. These mappings override automated matching logic and include optional notes. ```json { "explicit_map": [ { "src_areaNumber": 1048576, "tgt_areaID": 1, "note": "name+map" } ] } ``` -------------------------------- ### Define MD21 Chunk Structure Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/M2.md MD21 chunk contains pre-Legion style M2 data with MD20 magic header. All offsets within this chunk are relative to the chunk start rather than the file start. Introduced in Legion expansion (7.0.1.20740) as part of the chunked file format. ```c ===MD21=== {{Template:SectionBox/VersionRange|min_expansionlevel=7|min_build=7.0.1.20740}} The MD21 chunk contains the not yet chunked data, just like in the old format. The content literally is an pre legion file, starting with the MD20 magic. This also implies that all offsets inside this chunk are relative to the ''chunk'', not the ''file''. M2Data pre_legion_style_data; ``` -------------------------------- ### GLSL: Terrain Blending Fragment Shader Example Source: https://github.com/akspa0/parp-tools/blob/main/ADTPrefabTool/docs/wowdev.wiki/ADT_v18.md A fragment shader example in GLSL for blending multiple terrain textures based on alpha maps. It utilizes texture lookups and arithmetic operations to combine base textures with additional layers defined by alpha values from a fourth texture unit. ```glsl gl_FragColor = texture2D(texture0, vec2(gl_TexCoord[0])) * texture2D(texture3, vec2(gl_TexCoord[3])).r + texture2D(texture1, vec2(gl_TexCoord[1])) * texture2D(texture3, vec2(gl_TexCoord[3])).g + texture2D(texture2, vec2(gl_TexCoord[2])) * texture2D(texture3, vec2(gl_TexCoord[3])).b; ``` -------------------------------- ### CLI Command: convert Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/next/docs/plan.md Converts Warcraft ADT files from Alpha format to LK format, applying AreaID translation. Requires input paths for Alpha DBC and output directory, with optional DBC for WOTLK and AreaID overrides. ```bash --wdt-alpha (required) --out (required) --dbc-alpha --dbc-wotlk (required) --areaid-overrides (optional) ``` -------------------------------- ### Run WoWToolbox analysis tools (MPRR, MSCN, PM4-WMO, Spatial) via dotnet CLI Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/README.md Execute various specialized analysis tools provided by WoWToolbox using the .NET CLI. Each command runs a specific analyzer (MPRR Explorer, MSCN Collision Analysis, PM4-WMO Matching, Spatial Analyzer) with input and output paths. Ensure the project paths are correct and the required files are available. ```bash dotnet run --project src/WoWToolbox.MPRRExplorer -- -i "path/to/pm4/files" -o "output/mprr_analysis" ``` ```bash dotnet run --project src/WoWToolbox.MSCNExplorer -- -i "path/to/pm4/files" -o "output/mscn_analysis" ``` ```bash dotnet run --project src/WoWToolbox.PM4WmoMatcher -- -i "path/to/pm4/files" -w "path/to/wmo/files" -o "output/matching" ``` ```bash dotnet run --project src/WoWToolbox.SpatialAnalyzer -- -i "path/to/pm4/files" -o "output/spatial" ``` -------------------------------- ### CLI Entry and Parsing (PM4FacesTool, PM4NextExporter) Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/next/parpDocumentation/usage-guidelines.md Demonstrates argument parsing and batch dispatch across both tools. PM4FacesTool uses a lightweight internal parser with Options records and a simple Directory.EnumerateFiles loop. PM4NextExporter uses System.CommandLine via parpToolbox to orchestrate Pm4BatchProcessor and exports. Inputs are file/directory paths and flags; outputs are process decisions and export invocations. ```csharp var opts = ParseArgs(args); // --input/--group-by/--batch if (opts.Batch && Directory.Exists(opts.Input)) { var pm4s = Directory.EnumerateFiles(opts.Input, "*.pm4").ToList(); foreach (var pm4 in pm4s) ProcessOne(pm4, opts); } else ProcessOne(opts.Input, opts); ``` ```csharp var processor = new Pm4BatchProcessor(buildingService, wmoMatcher); var result = processor.Process(pm4Path); // buildings/WMO match if (assembly == "composite-hierarchy") { /* DSU PM4FacesTool */ } LegacyObjExporter.ExportAsync(pm4, objPath, filename); // parity OBJ ``` -------------------------------- ### Export buildings command integration Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/docs/BuildingLevelExporter_Plan.md Updates to Program.cs to add the export-buildings CLI command. Requires a scene.db argument and optionally accepts an output directory. Creates the output directory if it doesn't exist and calls the BuildingLevelExporter. ```csharp else if (args[0].Equals("export-buildings", StringComparison.OrdinalIgnoreCase)) { if (args.Length < 2) { Console.WriteLine("ERROR: export-buildings command requires argument."); return 1; } string dbPath = args[1]; string outDir = args.Length >= 3 ? args[2] : Path.Combine(Directory.GetCurrentDirectory(), "project_output", DateTime.Now.ToString("yyyyMMdd_HHmmss")); Directory.CreateDirectory(outDir); int exitCode = BuildingLevelExporter.ExportAllBuildings(dbPath, outDir); return exitCode; } ``` -------------------------------- ### Define C3Segment struct in C++ Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/Common_Types.md Defines a line segment with start and end points represented by C3Vector structs. ```cpp struct C3Segment { C3Vector start; C3Vector end; }; ``` -------------------------------- ### Define C3Segment structure Source: https://github.com/akspa0/parp-tools/blob/main/PM4Tool/docs/wowdev.wiki/Common_Types.md Defines a 3D line segment by specifying its start and end points, each represented as a 3-component float vector. ```C++ struct C3Segment { C3Vector start; C3Vector end; }; ``` -------------------------------- ### WCAnalyzer Project Dependencies Configuration Source: https://github.com/akspa0/parp-tools/blob/main/WCA/WCAnalyzer/WCAnalyzer.CLI/README.md XML configuration for NuGet package dependencies required by WCAnalyzer. Includes logging, JSON configuration, and SQLite database access libraries with specific version requirements. ```xml ``` -------------------------------- ### C4QuaternionCompressed Structure Source: https://github.com/akspa0/parp-tools/blob/main/ADTPrefabTool/docs/wowdev.wiki/MDX.md Defines a compressed quaternion structure used in WoW's MDX format, including methods for getting and setting quaternion values. ```C++ struct C4QuaternionCompressed { int64_t m_data; C4Quaternion Get() { C4Quaternion result; result.X = ( m_data >> 42 ) * 0.00000047683716; result.Y = (( m_data << 22 ) >> 43 ) * 0.00000095367432; result.Z = ((int32_t)( m_data << 11 ) >> 11) * 0.00000095367432; result.W = GetW( result.X, result.Y, result.Z ); return result; } double GetW(float x, float y, float z) { double len = 1.0 - (x * x + y * y + z * z); if ( len >= 0.00000095367432 ) return sqrt( len ); return 0.0; } void Set(C4Quaternion source) { int32_t sign = ( source->W >= 0.0 ? 1 : -1 ); int64_t x = (int64_t)( sign * source->X * 2097152.0 ) << 21; int64_t y = (int64_t)( sign * source->Y * 1048576.0 ) & 0x1FFFFF; int64_t z = (int64_t)( sign * source->Z * 1048576.0 ) & 0x1FFFFF; m_data = z | (( y | x ) << 21 ); } }; ``` -------------------------------- ### Execute WCAnalyzer CLI with Directory Input Source: https://github.com/akspa0/parp-tools/blob/main/WCA/WCAnalyzer/WCAnalyzer.CLI/README.md Main command to run WCAnalyzer tool specifying the directory containing ADT files to analyze. Includes support for optional output directory, listfile validation, and verbose logging parameters. ```bash dotnet run --project WCAnalyzer.CLI -- --directory [options] ``` -------------------------------- ### MPHD Chunk Processing Loop - WDT File Source: https://github.com/akspa0/parp-tools/blob/main/ADTPrefabTool/docs/wowdev.wiki/WDT.md Example loop processing the MPHD chunk in WDT files, clearing flags and data for each entry. ```C for( int i = 0; i < WDT_MPHD.something/8; i++ ) { WDT_MAIN[i].flags = 0; WDT_MAIN[i].somedata = 0; } ``` -------------------------------- ### C++ Helper: Fire Event When Enabled Source: https://github.com/akspa0/parp-tools/blob/main/PM4Tool/docs/wowdev.wiki/M2.md Example logic to fire an event if the current time passes the next enabled timestamp in its list. Uses a hypothetical getEventTimestamps helper; adapt to your engine/platform. ```cpp void fireEventIfEnabled(const M2Event& e, uint32_t now) { for (size_t i = 0; i < e.enabled.timestamps.size(); ++i) { if (now >= e.enabled.timestamps[i]) { triggerEvent(e.identifier, e.data, e.bone, e.position); } } } ``` -------------------------------- ### Run AlphaWDTAnalysisTool CLI for single map analysis and export Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/AlphaWDTAnalysisTool/README.md Executes the AlphaWDTAnalysisTool CLI via dotnet run, providing input WDT, listfiles, output directory, and export options. Includes optional area table, DBC definitions, and fuzzy asset matching flags. ```PowerShell dotnet run --project .\AlphaWDTAnalysisTool\AlphaWdtAnalyzer.Cli ` -- --input "..\..\test_data\0.5.5\tree\World\Maps\Azeroth\Azeroth.wdt" ` --listfile "..\..\test_data\community-listfile-withcapitals.csv" ` --lk-listfile "..\..\test_data\ of Warcraft 3x.txt" ` --out "..\..\out\0.5.5_decode2" ` --export-adt --export-dir "..\..\out\0.5.5_decode2" ` --area-alpha "..\..\test_data\0.5.5\tree\DBFilesClient\AreaTable.dbc" ` --dbc-dir "..\..\lib\WoWDBDefs\definitions" ` --asset-fuzzy on ``` -------------------------------- ### Clone Repository (Bash) Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/README.md This snippet demonstrates how to clone the PM4Tool repository from GitHub using the `git clone` command. It sets up the local environment for development and analysis. ```bash git clone https://github.com/your-org/PM4Tool.git cd PM4Tool ``` -------------------------------- ### WoW Shader File Structure and References Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/WFX.md Documents the WoW shader file structure including MapObj.wfx, MapObjU.wfx, Model2.wfx, and ShadowMap.wfx files. Each file contains specific shader definitions for different rendering purposes. The files are hardcoded into the client and reference BLS shader files for actual shader implementation. ```Shader Format // WoW Shader Files Structure // MapObj.wfx Particle MapObjDiffuse MapObjOpaque MapObjSpecular MapObjMetal MapObjEnv MapObjEnvMetal // MapObjU.wfx MapObjUDiffuse MapObjUOpaque MapObjUSpecular MapObjUMetal MapObjUEnv MapObjUEnvMetal // Model2.wfx Projected_ModMod Projected_ModAdd // ShadowMap.wfx ShadowMapRender ShadowMapRenderSL ``` -------------------------------- ### 3D Segment Structure (C3Segment) in C++ Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/docs/wowdev.wiki/Common_Types.md A line segment defined by start and end 3D float vectors. Represents edges or paths in WoW geometry. Depends on C3Vector; no direction computation included. ```cpp struct C3Segment { C3Vector start; C3Vector end; }; ``` -------------------------------- ### .NET Project Dependencies in XML Format Source: https://github.com/akspa0/parp-tools/blob/main/PM4Tool/memory-bank/techContext.md This XML snippet defines external dependencies for the WoWToolbox projects, including a local ProjectReference to Warcraft.NET and NuGet packages for testing, CLI, and YAML handling. It is used in .csproj files to manage assemblies and libraries. Inputs are package versions; outputs are resolved dependencies during build, with limitations on version compatibility for .NET 9.0. ```xml ``` -------------------------------- ### Export WDL as OBJ with normalization Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/next/docs/cli.md Example commands for exporting WDL files as OBJ with different normalization and export options. Shows default normalized export, vertical exaggeration, disabled normalization, and merged-only export modes. ```bash # OBJ normalized (default), per-tile and merged -dotnet run --project next/src/GillijimProject.Next.Cli -- wdl-obj --in C:/data/Azeroth.wdl --out-root ./out # GLB normalized with vertical exaggeration -dotnet run --project next/src/GillijimProject.Next.Cli -- wdl-glb --in C:/data/Azeroth.wdl --height-scale 1.5 # Disable normalization (raw grid units) -dotnet run --project next/src/GillijimProject.Next.Cli -- wdl-obj --in C:/data/Azeroth.wdl --no-normalize-world # Only merged OBJ -dotnet run --project next/src/GillijimProject.Next.Cli -- wdl-obj --in C:/data/Azeroth.wdl --only-merged ``` -------------------------------- ### Execute WoWToolbox test suite using dotnet test Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/PM4Tool/README.md Run the full WoWToolbox test suite or specific test categories via the .NET CLI. These commands help verify functionality, handle special cases, and validate PM4 file processing. Use the appropriate filter to target desired test groups. ```bash dotnet test test/WoWToolbox.Tests ``` ```bash dotnet test test/WoWToolbox.Tests --filter "Category=SpecialCases" ``` ```bash dotnet test test/WoWToolbox.Tests --filter "PM4FileTests" ``` -------------------------------- ### Define foreign_key template alias in C++ Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/Common_Types.md Provides a template-based reference type for linking to DBC/DB2 records. The example shows a uint16_t foreign key referencing the LiquidTypeRec::m_spellID field. ```cpp foreign_keyi liquid_spell_id; // type of reference, table referenced, variable referenced ``` -------------------------------- ### Define MWDR Structure (C) Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/ADT_v18.md Defines the MWDR structure, which specifies a range of indices into the MWDS array. It includes 'begin' and 'end' members representing the start and inclusive end of the range. ```C struct { uint32_t begin; // Index into [[#MWDS_.28Shadowlands.2B.29|MWDS]]. uint32_t end; // inclusive: [7, 10] = MWDS[7] + MWDS[8] + MWDS[9] + MWDS[10] } MWDR[]; ``` -------------------------------- ### AlphaWdtAnalyzer CLI usage syntax Source: https://github.com/akspa0/parp-tools/blob/main/gillijimproject_refactor/AlphaWDTAnalysisTool/README.md Shows the command-line options for the AlphaWdtAnalyzer tool, covering single-map and batch-map processing, input sources, listfiles, export directories, and DBCTool patching arguments. ```bash AlphaWdtAnalyzer Usage: Single map: AlphaWdtAnalyzer --input --listfile --out \ [--lk-listfile <3x.txt>] [--viz-html] [--no-fixups] \ --export-adt --export-dir --dbctool-patch-dir [--dbctool-lk-dir ] Batch maps: AlphaWdtAnalyzer --input-dir --listfile --out \ [--lk-listfile <3x.txt>] [--viz-html] [--no-fixups] \ --export-adt --export-dir --dbctool-patch-dir [--dbctool-lk-dir ] ``` -------------------------------- ### C# Adapter Layer - WmoFormatAdapter Source: https://github.com/akspa0/parp-tools/blob/main/parpToolbox/migration-plan/migration_phase1_setup.md This snippet demonstrates the implementation of a WmoFormatAdapter that bridges WoWFormatLib's WMO models to PM4Tool's domain models. It converts WoWFormatLib's WMO and WMOGroup structs into WoWToolbox.Core.v2.Models.Wmo and WmoGroup domain models respectively. This adapter enables interoperability between the two libraries. ```csharp public static class WmoFormatAdapter { public static WoWToolbox.Core.v2.Models.Wmo ToDomainModel(this WoWFormatLib.Structs.WMO.WMO wmo) { ... } public static WoWToolbox.Core.v2.Models.WmoGroup ToDomainModel(this WoWFormatLib.Structs.WMO.WMOGroup group) { ... } } ``` -------------------------------- ### MORB Entry Structure (C/C++) Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/WMO.md Defines the structure for a MORB entry, containing the start index and count for triangle strip indices, along with padding. This structure overwrites specific fields in MOBA. ```c struct MORB_entry { uint32_t start_index; uint16_t index_count; uint16_t padding; } ``` -------------------------------- ### MORB: Triangle Strip Indices (C/C++) Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/WMO.md Defines an array for triangle strip indices. This structure is relevant when triangle strips are enabled and modifies MOBA data, impacting the start and count of indices. ```c uint16_t triangle_strip_indices[]; ``` -------------------------------- ### Create M2 placement matrix in JavaScript Source: https://github.com/akspa0/parp-tools/blob/main/ProjectArcane/docs/ADT_v18_fulltext.md JavaScript function that creates a placement matrix to map M2 models to world coordinates using gl-matrix library. Handles coordinate system translation and scaling for proper model placement. ```javascript createPlacementMatrix : function(mddf) { var TILESIZE = 533.333333333; var posx = 32 * TILESIZE - mddf.position[0]; var posy = mddf.position[1]; var posz = 32 * TILESIZE - mddf.position[2]; var placementMatrix = mat4.create(); mat4.identity(placementMatrix); mat4.rotateX(placementMatrix, placementMatrix, glMatrix.toRadian(90)); mat4.rotateY(placementMatrix, placementMatrix, glMatrix.toRadian(90)); mat4.translate(placementMatrix, placementMatrix, [posx, posy, posz]); mat4.rotateY(placementMatrix, placementMatrix, glMatrix.toRadian(mddf.rotation[1] - 270)); mat4.rotateZ(placementMatrix, placementMatrix, glMatrix.toRadian(-mddf.rotation[0])); mat4.rotateX(placementMatrix, placementMatrix, glMatrix.toRadian(mddf.rotation[2] - 90)); mat4.scale(placementMatrix, placementMatrix, [mddf.scale / 1024, mddf.scale / 1024, mddf.scale / 1024]); return placementMatrix; } ``` -------------------------------- ### Convert Alpha WDT to WotLK ADT Source: https://context7.com/akspa0/parp-tools/llms.txt Command-line tool for converting Alpha WoW WDT/ADT files to WotLK format. Supports AreaID remapping and asset path fixups. Requires input WDT file and listfile for proper conversion. ```bash # Analyze Alpha WDT and export WotLK-compatible ADTs AlphaWdtAnalyzer --input AlphaWoW/World/Maps/Azeroth/Azeroth.wdt \ --listfile community-listfile-withcapitals.csv \ --export-adt \ --export-dir output/wotlk_adts ``` ```bash # With AreaID remapping using DBC crosswalk AlphaWdtAnalyzer --input AlphaWoW/World/Maps/Azeroth/Azeroth.wdt \ --listfile community-listfile-withcapitals.csv \ --export-adt \ --export-dir output/ \ --area-remap areatable_053_to_335_crosswalk.json ``` ```bash # Asset path fixup (replace Alpha paths with WotLK equivalents) AlphaWdtAnalyzer --input Alpha/Azeroth.wdt \ --listfile community-listfile-withcapitals.csv \ --export-adt \ --export-dir output/ \ --fixup-assets \ --wotlk-listfile listfile-3.x.txt ``` ```bash # Full conversion pipeline AlphaWdtAnalyzer --input Alpha/TestMap.wdt \ --listfile community-listfile.csv \ --export-adt \ --export-dir converted/ \ --area-remap remap.json \ --fixup-assets \ --wotlk-listfile wotlk.txt \ --verbose ```