48 Commits

Author SHA1 Message Date
Kawe Mazidjatari
3649f9be5c Remove old comment
This field has been reverse engineered.
2023-03-25 17:14:04 +01:00
Kawe Mazidjatari
dd48093c23 Add experimental switch header
This header allows us to properly switch between experimental/finished STD implementations without having to adjust the source code (required for compiling on older versions of the Visual Studio 2017 compiler).
2023-03-20 00:17:29 +01:00
Kawe Mazidjatari
227885a69f Merge recastnavigation/recastnavigation@b51925bb87, recastnavigation/recastnavigation@7501007439 and recastnavigation/recastnavigation@405cc095ab
Everything has been adjusted to maintain compatibility with the game engine.
2023-02-21 18:19:03 +01:00
Kawe Mazidjatari
4e396728c3 Fix typos 2023-02-21 17:56:56 +01:00
Kawe Mazidjatari
ea18f30eda Fix incorrect rasterization at tile borders (recastnavigation/recastnavigation#476)
Merge recastnavigation/recastnavigation@3901c5854c
2022-11-25 00:05:36 +01:00
Kawe Mazidjatari
edd1c62352 Change vperpXZ to vperpXY 2022-10-22 21:59:57 +02:00
Kawe Mazidjatari
8709a256d9 Use closestPointOnPoly instead of getPolyHeight in dtNavMeshQuery::findRandomPoint 2022-10-22 21:59:57 +02:00
Kawe Mazidjatari
56dd3802f8 Recast & Detour XZY left overs to XYZ
Height should be set on the z axis.
2022-10-22 21:47:07 +02:00
Kawe Mazidjatari
c1ca5d0878 Fix spelling mistakes in Recast & Detour library 2022-10-07 22:32:08 +02:00
Kawe Mazidjatari
9d06a02614 General cleanup
* Use Cbuf functions for executing commands in ImGui panels.
* Use const qualifiers for all vftable indexes.
2022-08-09 02:35:00 +02:00
Kawe Mazidjatari
ea5f17b4ca Light cleanup
* Moved ConVar usage text that where part of the help string to the usage string parameter.
* Flagged ConVar 'bhit_abs_origin' as FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED.
* Flagged ConCommand 'bhit' as FCVAR_DEVELOPMENTONLY | FCVAR_GAMEDLL.
* Check 'bhit_enable' before running the 'bhit' command callback.
* Fixed spelling in a few area's.
2022-08-04 16:34:23 +02:00
Kawe Mazidjatari
9eeaebaf6a Even More XZY->XYZ changes 2022-07-28 15:45:02 +02:00
Kawe Mazidjatari
cbaf10478a More XZY->XYZ changes
* dtIntersectSegSeg2D: Calculate over zy-plane instead.
* dtOverlapPolyPoly2D: Calculate over zy-plane instead.
* dtNavMeshQuery::findRandomPoint: z = h.
* dtNavMeshQuery::raycast: Invert hit normals.
* Update all comments to use xyz vector instead (previously xzy (xz-plane z-height)).
2022-07-28 14:24:29 +02:00
Kawe Mazidjatari
34076142ba More XZY->XYZ changes 2022-07-28 03:21:20 +02:00
Kawe Mazidjatari
ce28ea2691 Even more offMeshConnections debug draw fixes 2022-07-28 02:07:13 +02:00
Kawe Mazidjatari
8af97beb57 Fix offMeshConnections debug draw 2022-07-28 01:48:17 +02:00
Kawe Mazidjatari
6a1b6c580a Increase debug arow size 2022-07-28 00:52:12 +02:00
Kawe Mazidjatari
37637bc56a Properly fix cylinder, circle and arrow debug draw for Recast. 2022-07-28 00:41:47 +02:00
Kawe Mazidjatari
87a42efd72 Uncomment and fix crowd anticipate turn debug draw
Moved internal functions to their own translation unit.
2022-07-27 21:05:27 +02:00
Kawe Mazidjatari
88a29f2770 Improve crowd speed/acceleration/braking
Changed to values comparable to game.
Added sliders for acceleration and speed.
2022-07-27 20:08:17 +02:00
Kawe Mazidjatari
03698a4a5f Fix DetourCrowd
XZY -> XYZ.
Crowd agents now traverse over the poly surfaces properly.
2022-07-27 17:48:51 +02:00
Kawe Mazidjatari
0576749de0 Use transparent area color for polymesh debug draw 2022-07-27 14:30:30 +02:00
Kawe Mazidjatari
c16d87ebc5 Fix more Recast & Detour debug drawing
* XZY -> XYZ.
2022-07-27 14:29:54 +02:00
Kawe Mazidjatari
4c8027b319 Fix duDebugDrawHeightfieldLayer and RecastDebugDraw cleanup 2022-07-27 12:38:02 +02:00
Kawe Mazidjatari
df99664d2a Working Recast convex hull 2022-07-27 11:11:41 +02:00
Kawe Mazidjatari
da77600baa More XZY->XYZ places 2022-07-27 10:58:54 +02:00
Kawe Mazidjatari
8757d0a43f NavMesh convex volume drawing somewhat working 2022-07-27 03:50:11 +02:00
Kawe Mazidjatari
112a530d5a Improve Recast & Detour and NavMesh generation
* Add missing dtQueryFilter field (some flag used in the engine but not sure yet what it does).
* Set tile->polysEnd and tile->offMeshConsEnd to end of polys and offMeshCons array pointer (if ever needed).
* Set camera perspective to 75 (previous 50).
* Improve theme.
* Lowered the climb height for all hulls (this improves NavMesh generation around low obstacles, previously it would create a poly connecting the ground on the side with the surface of the object around where it connects with the ground, causing AI to take this route instead and kind of 'glitch' onto the surface).
2022-07-26 14:23:02 +02:00
Kawe Mazidjatari
ff0ae1c13b Fix dtMeshTile structure
Removed old member that should had been removed earlier. All members align now.
2022-07-22 12:28:39 +02:00
Kawe Mazidjatari
c850d52d1b Add NavMesh poly bounds debug overlay 2022-07-21 02:21:59 +02:00
Kawe Mazidjatari
79b4d7889a Remove non-existent member
This member was actually offMeshConsEnd
2022-07-20 17:31:35 +02:00
Kawe Mazidjatari
c0d3dafa6f Update dtNavMeshQuery structure
Member 'filter' has been moved out of 'dtNavMeshQuery::dtQueryData'. New offset = 0x60 (after m_openList). Renamed to 'm_queryFilter' to maintain consistency.
2022-07-20 01:33:09 +02:00
Kawe Mazidjatari
59dd3e2228 NavMesh system improvements
* Confirmed DT_MAX_AREAS size being 32 (originally 64).
* header->offMeshEnds to -1.
* Added pointer to 'g_pHullMask'.
2022-07-19 22:00:40 +02:00
Kawe Mazidjatari
3d0162038a Improved navmesh structs
New member: header->offMeshEnds (this is used in Detour_LevelInit which sets fields to -1 starting at the pointer to end of offMeshCons array).

Currently set to 0 so the paths in opcodes.cpp could be disabled.
2022-07-18 21:38:07 +02:00
Kawe Mazidjatari
9f27b58f95 Improve struct member naming consistency
Improved alignment of class 'Sample' and improved naming consistency.
2022-07-18 19:32:36 +02:00
Kawe Mazidjatari
57bb9dffce Update dtNavMesh, dtNavMeshParams and dtMeshTile structures
dtNavMesh is now almost fully mapped out (most members should be correct, the only unsure ones are the unknowns and the mesh/tile flags).

dtNavMeshParams has one new field (I think the last field determines the precomputed malloc size, but I'm not very sure. It would make sense with the inline loop in 'Detour_LevelInit()' setting a certain field in each tile to -1).

dtMeshTile has one extra field (currently unknown) and the renamed unk0 field was is a pointer to the end of the 'polys' array.
2022-07-18 12:38:41 +02:00
rexx
ddae4d4775 update dtNavMesh and dtMeshTile structs 2022-07-13 19:48:19 +01:00
Kawe Mazidjatari
46a3535b27 Update dtMeshTile structure
Actual size is 0x78 (header2 also gets assigned to the header pointer in r5apex.exe + F43FFA).
2022-07-13 12:08:10 +02:00
Kawe Mazidjatari
a778d910e7 Fix rare crash in naveditor
Running tests in the naveditor without building navigation segfaults the application.

Reduced verbose prints when building navigation.
2022-04-22 02:31:06 +02:00
Kawe Mazidjatari
72ca651003 Cleanup DetourNavMesh.h 2022-03-26 00:44:42 +01:00
Kawe Mazidjatari
9b33e1b94e Fix more debugdraw 2022-03-19 12:56:22 +01:00
Kawe Mazidjatari
35ad8554a5 Somewhat correct working navmesh
The reachability table needs to be figured out still. The issue should be very small, but at the moment I do not have time for it.

The pointer to the table, and table pointers to data is correct, however, not a single poly is ever getting marked as 'reachable' (0xffffffff). This could be either within recast itself (see build_link_table() and set_reachable() functions), or the way the engine parses the data. The function that determines whether poly is reachable is located at '0x140F448E0'
2022-03-18 03:14:07 +01:00
Amos
2fb7aef885 Update Pch.h 2022-03-16 01:35:42 +01:00
Amos
7596f44655 Fix alignment 2022-03-16 01:35:29 +01:00
Amos
243c5e4af7 Fix cylinder debug draw 2022-03-16 01:33:58 +01:00
Amos
7cd73893f4 Build navmesh files to game directory
And additional compiler improvements
2022-03-13 22:20:02 +01:00
Amos
3cf36b5d61 Increase compile performance even more for NavMesh Editor
Cleaned up redundant includes
Reordered required ones
2022-03-13 03:00:07 +01:00
Amos
ac94f4fd68 Add Recast & Detour libraries to project
Libraries taken from https://github.com/r-ex/r2recast/tree/apex_legends
2022-03-12 15:11:32 +01:00