4090 Commits

Author SHA1 Message Date
Kawe Mazidjatari
6b86c9bc1b Recast: fix comment 2024-07-12 21:40:16 +02:00
Kawe Mazidjatari
c04aa735ff Recast: code deduplication
Use new function introduced in commit 2f9776d495f6a5c7bedccc3566b81d41d28e09f6.
2024-07-12 21:39:45 +02:00
Kawe Mazidjatari
2f9776d495 Recast: properly set dtPoly::surfaceArea
This field has been reverse engineered and set correctly in this commit. The field contains the quantized surface area of the polygon.
2024-07-12 21:38:50 +02:00
Kawe Mazidjatari
61705cb85e Recast: add dtMathRoundf 2024-07-12 21:34:00 +02:00
Kawe Mazidjatari
e8753cdd14 Recast: fix more comments 2024-07-12 16:09:05 +02:00
Kawe Mazidjatari
1c748b2227 Recast: improve clarity for UI toggle
It was unclear whether this was for toggling all details at once, or showing toggled details on all crowds. It was the latter, improved checkbox naming.
2024-07-12 14:49:49 +02:00
Kawe Mazidjatari
533d6c33e1 Recast: update documentation accordingly to XZY -> XYZ change 2024-07-12 14:14:26 +02:00
Kawe Mazidjatari
67db52508b Recast: fix typo's in comments 2024-07-12 14:13:49 +02:00
Kawe Mazidjatari
88052ba558 Recast: fix poly detail height bug when height isn't found
The height couldn't be found on some edge case scenarios (typically complex geometry), but in these cases the height was still set to (unsigned short)-1, causing it to return a height very far into positive Z. The vert would therefore appears very far into the sky. This patch fixes this problem.
2024-07-12 14:13:08 +02:00
Kawe Mazidjatari
f95eb13ab3 Recast: tilemesh editor refactor
Move common code to Editor_Common and fix solomesh. Solomesh is useful for debugging recast as it allows for generating everything in 1 tile. Also did numerous fixes for the tilecache code, though this is still broken and won't be really used for the r5sdk project, but its nice to have for a potential project outside r5sdk that uses the xyz coordination system, which avoids having to run the navmesh through a conversion pass in runtime.
2024-07-12 13:01:47 +02:00
Kawe Mazidjatari
59a8f12e0e Recast: allow setting table count in dtNavMesh::init
Needed for pre-allocation on solo mesh.
2024-07-12 12:53:43 +02:00
Kawe Mazidjatari
5d34723773 Recast: adjustments for tile cache
Tile cache still doesn't generate properly, these fixes are the start.
2024-07-12 12:52:30 +02:00
Kawe Mazidjatari
06ba52d4e6 Recast: light cleanup 2024-07-12 12:49:41 +02:00
Kawe Mazidjatari
ba23bfa471 Recast: set font to DroidSans
The original font the navigation editor shipped with.
2024-07-11 13:55:19 +02:00
Kawe Mazidjatari
2fd3eda52a Recast: fix item ID collisions
Exclude Flags didn't work as they shared the same item ID's as Include Flags, and Include Flags was before Exclude Flags. Both have unique ID's now.
2024-07-11 13:54:39 +02:00
Kawe Mazidjatari
69ee9d07a3 Recast: remove extraneous include
Use the non-std version of isfinite instead.
2024-07-11 09:31:48 +02:00
Kawe Mazidjatari
f7d9cefc80 Recast: remove mesh import flipping code
This was initially implemented to work around a normal flipping bug caused by the BSP to OBJ converter script, and the way Blender exports assets (it flips the axis on export). Removed code as we should instead use the fixed scripts and properly export the adjusted models from the DCC tools.
2024-07-11 09:26:05 +02:00
Kawe Mazidjatari
d38bdd1abd Recast: improve text and value representation on GUI
Small UX improvement.
2024-07-11 09:22:08 +02:00
Kawe Mazidjatari
5955ac7864 Recast: fix incorrect comment (XZY -> XYZ)
Raycast ignores the z-value after the XZY to XYZ change, previously it was the y-value.
2024-07-11 09:20:55 +02:00
Kawe Mazidjatari
d386a676d2 Recast: fix regression in NavMeshTesterTool
Caused by the implementation of dtNavMesh::isGoalPolyReachable. when this was false, everything was reset, including the start polyref causing "Set Random End" to always fail. isGoalPolyReachable also wasn't supposed to be checked on every mode, e.g. the neighbourhood or poly circle mode doesn't rely on a goal polyref.
2024-07-11 09:19:51 +02:00
Kawe Mazidjatari
e999871b32 Resource: sdk resource file cleanup 2024-07-11 02:01:26 +02:00
Kawe Mazidjatari
b35266682b Recast: use SDL log wrappers for warnings/errors instead 2024-07-11 02:00:40 +02:00
Kawe Mazidjatari
c23c953be1 Recast: set window icon and title 2024-07-11 01:37:04 +02:00
Kawe Mazidjatari
4d94a9c1ba Recast: align file menu's with main menu's
Light UX improvement.
2024-07-11 00:29:44 +02:00
Kawe Mazidjatari
69e88229c0 Recast: fix typo in comment 2024-07-10 20:38:15 +02:00
Kawe Mazidjatari
eff312acf5 Recast: fix dtRandomPointInConvexPoly (XZY -> XYZ)
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.
2024-07-10 20:36:24 +02:00
Kawe Mazidjatari
5cf3fd302f Recast: use the correct vertex order instead of flipping them
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.
2024-07-10 17:52:12 +02:00
Kawe Mazidjatari
63d85f0db5 Recast: some minor consistency changes
UI displays navmesh as NavMesh, changed it everywhere for consistency.
2024-07-10 11:13:06 +02:00
Kawe Mazidjatari
11a827d548 Recast: fix missed XZY -> XYZ conversions in dtNavMeshQuery
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).
2024-07-10 11:12:13 +02:00
Kawe Mazidjatari
df94ba0314 Recast: fix user interface bug
"Pathfind Sliced" was checking on the wrong member variable, and the check for enabling "Set Random End" and "Make Random Points Around" was inverted.
2024-07-10 11:09:30 +02:00
Kawe Mazidjatari
192f5dd326 Recast: rework render options
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.
2024-07-10 11:06:50 +02:00
Kawe Mazidjatari
2f9908928c
Merge pull request #122 from Mauler125/recast_imgui_upgrade
Recast NavMesh editor ImGui upgrade
2024-07-09 20:19:26 +02:00
Kawe Mazidjatari
8f20326983 Recast: create a nice gradient background
Makes the application look more solid.
2024-07-09 20:15:54 +02:00
Kawe Mazidjatari
76ecbd8062 Recast: polish GUI layout
Make sure nothing clips outside the rects and make it look good.
2024-07-09 19:40:28 +02:00
Kawe Mazidjatari
42e2c8d309 Recast: fix level name truncation
Make sure the largest map name fits in the window.
2024-07-09 16:49:49 +02:00
Kawe Mazidjatari
6fd9a5b936 Recast: allow closing the testcase window
If the testcase window was opened, there was no way to close it without opening a test case. This patch allows you to toggle it.
2024-07-09 16:40:09 +02:00
Kawe Mazidjatari
f843c69672 Recast: properly render text over screen
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.
2024-07-09 16:40:08 +02:00
Kawe Mazidjatari
f964db2ccf ImGui: create dedicated file for wrappers and implement RenderText
All future wrappers go here.
2024-07-09 16:31:05 +02:00
Kawe Mazidjatari
9623c1640d Recast: initialize theme and improve UX
New theme and allow user to resize or move all the panels around.
2024-07-09 12:31:35 +02:00
Kawe Mazidjatari
f01fef72cc ImGui: move style initialization code to separate file
Make it easier for shared to to utilize this.
2024-07-09 12:30:34 +02:00
Kawe Mazidjatari
ffeebd96d2 Recast: remove comment of a fixed issue
Fixed in commit 1dbc9cd52adc99c537a45215ab1761d3a53e2306.
2024-07-09 11:46:29 +02:00
Kawe Mazidjatari
9bbab5b15e Recast: remove unused tool parameters
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.
2024-07-09 11:45:21 +02:00
Kawe Mazidjatari
fdfd7ef416 Recast: replace old graph plotter with ImPlot
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.
2024-07-09 11:41:05 +02:00
Kawe Mazidjatari
1dbc9cd52a Recast: fix crash caused by uninitialized member variable
Should've been initialized. Caused a crash sometimes when loading up the NavMeshTesterTool as this will be some random value.
2024-07-09 11:41:05 +02:00
Kawe Mazidjatari
e2c48c49db Recast: upgrade legacy ImGui implementation to 1.90.4 (WIP)
Major upgrade to newer library. This is still work in progress, there are many bugs.
2024-07-09 11:41:05 +02:00
Kawe Mazidjatari
4c37d8fc69 Recast: fix crash caused by uninitialized member variable
Should've been initialized. Caused a crash sometimes when loading up the NavMeshTesterTool as this will be some random value.
2024-07-09 01:16:28 +02:00
Kawe Mazidjatari
c2df5e19bf ImGui:: add ImPlot (ImGui Plotter tools)
Will be used for upgrading ImGui in the Recast NavMesh editor, and future tooling in-game.
2024-07-09 00:57:31 +02:00
Kawe Mazidjatari
4c43f08248 ImGui: move core demo to 'demo' directory
Light cleanup.
2024-07-09 00:56:11 +02:00
Kawe Mazidjatari
c813667d61 ImGui:: add SDL2 and OpenGL2 backends
Will be used for upgrading ImGui in the Recast NavMesh editor.
2024-07-09 00:30:18 +02:00
Kawe Mazidjatari
ca385bd37d Recast: improve poly groups text overlay
Temporary improvement.
2024-07-08 17:29:22 +02:00