304 Commits

Author SHA1 Message Date
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
Amos
69b385a21a Change type to int in for loop
Tests against int, not size_t.
2022-06-30 11:29:36 +02:00
Kawe Mazidjatari
3323c3fadb Small ImGui theme adjustments 2022-06-27 14:48:03 +02:00
Kawe Mazidjatari
98c43fd6c1 Rename CConLog to ConLog_t 2022-06-26 17:40:02 +02:00
Kawe Mazidjatari
5480d450a2 Update imgui_logger.cpp 2022-06-26 17:10:52 +02:00
Kawe Mazidjatari
efe71fbe24 ImGui console UX improvements
* Fixed click-through parent window.
* Keep selection position when lines get cleared.
* Keep cursor position when lines get cleared.
* Ensure cursor visibility when dragging cursor outside rect.
* Falter free scrolling in autocomplete window.
* Falter free scrolling in logging window (window no longer stutters when lines get cleared).
2022-06-26 16:47:00 +02:00
Kawe Mazidjatari
d7a004a0eb Fixed bug where auto-scrolling occasionally gets disabled
Issue happened when scrolling back, most of the time it will work, but there is always jitter in the first frame after the change which could result in ImGui::GetScrollY() <= ImGui::GetScrollMaxY() resulting in auto-scroll disable.
Only scroll back if ImGui::GetScrollY() <= ImGui::GetScrollMaxY() and always reset value of CConsole::m_nScrollBack.
2022-06-24 18:28:26 +02:00
Kawe Mazidjatari
cdc32531eb Prevent selection in console when scrollbar is active
Fixed issue where scrolling with the scrollbar would select text whilst sliding.
Improved UX by not showing the text edit cursor when scrollbar is hovered.
2022-06-24 17:43:50 +02:00
Kawe Mazidjatari
88259a69ae Allow selection while cursor is no longer hovered over child window 2022-06-24 15:23:14 +02:00
Kawe Mazidjatari
2eda8235b7 Slight theming tweaks
Minor improvements to small detail:
No child border on console on default theme (this is invisible).
Tweaked first use size and min size where by default the text would always perfectly align between ScrollY min and max.
2022-06-24 12:45:47 +02:00
Kawe Mazidjatari
add5c577ff Improve ImGui theme system
-imgui_theme "modern" = Respawn theme.
-imgui_theme "legacy" = Valve theme.
No args = default theme.
2022-06-24 12:22:04 +02:00
Kawe Mazidjatari
e1ede0c995 Remove unused function from imgui_logger.cpp 2022-06-24 12:12:00 +02:00
Kawe Mazidjatari
145b5dcd13 CTextLogger cleanup
Reordered structure.
Use C++ style casts.
changed m_flLastClick (float) to double.
2022-06-22 00:33:12 +02:00
Kawe Mazidjatari
76ec4b8f4a Improve console scrolling
Moved auto scrolling logic to CTextLogger.
Removed redundant code in CTextLogger.
Added bool param to CTextLogger::RemoveLine to determine whether or not to lock the mutex (internal operations should not lock).
Fixed issue where scrolling with cursor is not possible when auto-scroll is set or ScrollY is towards its max.
Fixed copy button (copy all text in console via GUI, ctrl + a - ctrl + v alternative).
2022-06-21 23:25:15 +02:00
Kawe Mazidjatari
a436b70601 CConsole / CTextLogger optimizations
CConsole: cast to proper types.
CTextLogger: only compute line string if filter is active.
2022-06-21 20:20:12 +02:00
Kawe Mazidjatari
3e2c395584 Don't append newlines on obtained text
Newlines are added through the SDK, and the CTextLogger class has been modified to insert a newline when in encounters a newline character.
2022-06-21 11:32:40 +02:00
Kawe Mazidjatari
a534ef1e3c Type untyped variables in CTextLogger
All of these are known types that aren't going to change.
2022-06-21 11:13:30 +02:00
Kawe Mazidjatari
f7dd4089f0 Logger improvements
Fix crash cases due to concurrent access and wrong type casting.
Improve filter logic (now greys out everything outside criteria).

TODO: Return 'size_t' for everything size related.
2022-06-21 10:14:20 +02:00
Kawe Mazidjatari
da299a002c Reimplement text filter
Could be better at some point, currently removes anything not matching criteria resulting in gaps.
But on the other side it might be good as the location of all occurrences are known (should make it easier to see when it is logged during the process).

Revisit in the future.
2022-06-20 20:21:52 +02:00
Kawe Mazidjatari
7d749fc53a Skip space characters properly in CTextLogger 2022-06-20 13:23:38 +02:00
Kawe Mazidjatari
f52bfb139e Remove m_bReadOnly from CTextLogger
User can't modify the log text, it can only be modified through code.
2022-06-20 13:23:11 +02:00
Kawe Mazidjatari
33aebfb89d ImGui theme improvements 2022-06-20 13:05:50 +02:00