Don't render the geom off-mesh connection, this is already done when the tool is enabled, and we don't want to render it outside the tool since it would overlap with the built off-mesh connection.
EditorPolyAreas::EDITOR_POLYAREA_JUMP is supposed to be right after EDITOR_POLYAREA_GROUND, this enumerant has been moved there (in exchange of water which is as far as i can tell unused). For the off-mesh connection tool the flags have to be set to EDITOR_POLYFLAGS_WALK (this is what Titanfall 2 does). Off-mesh links don't work yet, more work is needed in dtLink.
Some data that is in between the poly's and links weren't skipped properly. The engine skips this data in dtNavMesh::addTile, we didn't. This is now skipped properly by advancing over it before going over the links. The 2nd and 3rd bug was that the poly's end pointer, and off-mesh connections end pointer was set to the data size of the poly's and off-mesh connections rather than the poly and off-mesh con count. This small oversight has been fixed and the end pointers are now set correctly. The function dtCreateNavMeshData has also been updated to take this data into account correctly, it was using the Titanfall 2 NavMesh (NavMesh Set Version 5), structure sizes but this has been changed in Apex (NavMesh Set Version 7 and 8). These fixes did reduce the NavMesh's file size by a few kilobytes per megabyte.
Tool states aren't always set, they are typically only set for the active tool if an option changed, but if nothing changed, then nothing will get updated (including the navmesh handle) so dangling pointers will be used. This makes sure everything gets initialized.
the box's shape rendered correctly, but the faces were in the wrong order. The top face was on the side, so the voxel debug view didn't render correctly.
This is useful when a project file (.GSET) has been loaded with predetermined navmesh bounds, which allows you to check the new bounds to the old, and also see what you will be resetting too if mistakes were made during the modification thereof.
When loading from .gset, the editor would clip anything outside the stored bounds, but we still need the outer bounds as otherwise editing the existing bounds would be a lot harder.
The thickness of the bounds were increased, so the red one doesn't need to be darker anymore. Previously it was hard to see compared to the blue poly's.
There was an issue where Recast's common math library was less complete than that of Detour. Some common math operations were also isolated in specific translation units causing copies everywhere. All common math operations have been moved to the Shared library ultimately fixing all the above issues.
Make sure there is a navmesh before attempting to build static pathing data. The crash gets triggered when loading geometry, and trying to build a tile without generating the navmesh first.
The near clip plane has been increased significantly. This was never adjusted correctly with the large scale change that was done to make Recast work with the scale of Titanfall and Apex maps. The near clipping is still minimal but the z-fighting problem has been fixed entirely. The offset for Recast and Detour debug drawing have also been reduced significantly as a result, since they no longer need to be offset that much. Also removed a comment regarding the projection matrix since we have to adjust the projection matric for XYZ rendering.
Hull human wasn't able to reach places where it should. Multiplying it with its scale (0.5), makes them able to do so, and the navmeshes also look very similar to Titanfall 2 navmeshes around door frames and corridors now.
User can now define where the navmesh will be build and what would be excluded in the map. Also adjusted some colors of existing bounding boxes to make them more visible. They weren't as visible as they used to be after the UX and rendering improvements.
The depth testing is useful when rendering the navmesh without a background (e.g. disabling the rendering of the input geom). But when rendering with the geometry, it should be disabled as otherwise some data will overlap and become invisible (the off-mesh links or poly verts, or boundaries when looking from a tilted perspective).
This function was originally 'duDebugDrawHeightfieldLayers', it was once renamed by the Recast authors, but the old declaration has never been removed.
New ability to adjust it in all directions, recast and detour offsets are separate. By default, the Recast mesh renders 20 units from the input geom and Detour 30 units to avoid z-fighting.
Going below a cell size of 12 will cause bad artifacts during the rasterization of the navmesh as the voxel mold would be too detailed. Also clamped the min of the cell height to 0.4 since any value below that will result in no navmesh getting generated on correct topology, so no point going lower.
The original min values for size and height were 0.1, but due to the scale differences with our maps and what recast was originally configured with, adjustments had to be made.
- Make NavMesh light blue (original color, but more solid and vibrant).
- Make Recast poly mesh and height field's darker blue, but more opaque.
- Increase render thickness of outer poly boundaries (should and will be an option in the debug class soon).
- Increase render size of poly verts (should and will be an option in the debug class soon).
- Make gradient background color slightly more uniform with the GUI.
Agent's height should not be multiplied by its scale, but rather the agent's climb height. It should also be lower than the agent's height. So an agent of height 75 should have a climb height of height * scale, which for human is 36 (72 * 0.5). Also increased the max clamp for the "Max Climb" slider.