Commit 11a827d54805b605a2500b4f6f13b8237bfffffd fixes 'dtNavMeshQuery::findRandomPoint' and 'dtNavMeshQuery::findRandomPointAroundCircle' never returning a poly as the vert indexing was inverted.
Although random positions are returned now, they are always either on a tile border, or a poly triangle. This patch fixes the incorrect calculation of triangle area, and output position writing caused by a similar mixup of verts.
Instead of flipping them in dtNavMeshQuery::getPortalPoints, check them in the right order in dtNavMeshQuery::findStraightPath since other code depend on getPortalPoints's results not being flipped. Also fixed some types in comments.
ZY needs to be flipped for YZ, previously the function would never find a poly as the reservoir sampler always failed (polyArea was always a large negative number).
Also used flag approach for tilemesh rendering, previously you could only render one thing, or a hardcoded set of things at a time. Now you can toggle what you want to draw (e.g. the voxels and detail polys). Also moved all NavMesh drawing options to the NavMesh category instead of TileMesh, e.gm the BVTree drawing options. This patch also allows you to toggle the input mesh off separately from the NavMesh, which is useful for larger levels.
Use the drawlist wrapper instead of relying on ImGui windows (which didn't work to begin with). Also fixed all text colors that weren't converted from the previous library.
These parameters are unused, but since they are checked on and unset, they caused certain elements to not display. Removed them since the expansion logic is now fully handled by Dear ImGui.
The old one doesn't work properly with the new ImGui library since the upgrade in commit 949d01da7935d957e0a01cbd592364e74008d8c4. Moved to the use of ImPlot which was added in commit c2df5e19bf332db0ff24849ee5bbb4c033c51117.
The new mapping was never applied on the disjoint set, causing the indices to be off during traversal table building. Also made the initialization of the disjoint set the responsibility of dtCreateDisjointPolyGroups.
Set it to the first usable one instead of "none" since we will be using the anim types a lot more often than "none". Also removed some extraneous separators to enhance the UX.
Everything 'dtAlloc', 'rcAlloc', 'dtAlloc', 'dtFree', got renamed into 'rdAlloc', 'rdFree'. There were a lot of object allocators that used these suffixes which were not accounted for causing those to be renamed. Everything has been renamed back to their original names (excluding the actual rdAlloc/rdFree functions as these were supposed to be renamed).
No code logic was changed in this commit.
The accidental renaming was caused in commit fa8d89d287752782ebdd5d9563f04fa72ef0bee9
The editor now takes the static pathing data into account when creating paths/testing the navmesh using the NavMeshTesterTool or CrowdTool. An option is made allowing you to select which traverse anim type you want to use for pathing (each of them uses a different traversal table, thus giving them different options as to which links and jumps they can take).
This allows us to test AI withing the editor itself, thus saving a lot of time shuffling navmesh files around and reloading them in-game.
(unsigned short)-1 (65535) is technically a valid poly group. We also count from 2 as 1 is reserved for unusable poly's, and 0 was reserved kept reserved for simplicity so just use 0 as the null identifier.
- Separate disjoint set and traversal table building code
- Use game types and data to determine what to build into the traversal tables (e.g., 5 traversal tables for _small and only 1 for the rest).
- Automatically initialize the editor using the _small navmesh parameters instead of the broken defaults.
There was always a problem dealing with core integral types accros various projects, since we typically only use IDA's pseudo definitions for rebuilding decompiled functions. It however did define almost all the integral types we use throughout the SDK. These types have been commented out and a new header has been made that defines everything we need (and we can add more in the future if this deems necessary). This new header is included with tier0/basetypes.h, so all projects have access to it and the tier0 headers will work out of the box without defining anything new.
These values seem to generate navmeshes that are almost identical to Titanfall 2 single player navmeshes in terms of geometry calculations per navmesh size. Its likely these are the actual values used internally to create these.