-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New UI panel: CollisionsDebug (top menubar > tools) #2939
Conversation
Current "Debug Collisions" overlay (cvar 'diag_debug_collisions') is non-interactive, laggy and with unreadable text labels. The new CollisionsDebugUI allows enabling/disabling the overlays interactively and draws labels using DearIMGUI (like net labels.) Changes in this commit: * created the new GUI window, with all visibility/hover/update mechanics (it's getting convoluted). * ported the eventbox visiualization code from Collisions.cpp to the new GUI window. Boxes remain meshed, labels are DearIMGUI.
Collision triangles are visualized as orange objects, same as before. Labels are drawn by DearIMGUI. Unlike before, the triangles aren't one mega-mesh covering whole map, but individual meshes. Visibility range can be adjusted in UI.
Reused old code in Collisions.cpp, just added root node to control visibility and fixed drawing distance. This debug view is amusing because it documents how useless the grid system is. Map is dividied into 2x2meter blocks (works only horizontally! height is unlimited!), each having an unlimited capacity for collision triangles. The shade of green/yellow/red indicates occupancy (green = 0, red=CELL_BLOCKSIZE(146)). Naturally, a much better system would be a search tree where collision triangles are distributed evenly.
13423dc
to
d6e5acb
Compare
A few bugs I've noticed while testing this:
|
d6e5acb
to
3870bbb
Compare
|
Added constant DEFAULT_DRAWDIST=200 for all debug meshes. CollisionsDebug: factored out funcs `SetDrawFoo()`, `ClearFooVisuals()`. Collisions.cpp: material gen code moved to CollisionsDebugUI, with duplication check. Fixed missing cleanup of cell meshes. Added "dump debug meshes" rescue buttons - especially important for cells.
9f02125
to
781e902
Compare
Works fine and looks great. Only "Show look up cells" crashes here, no segfault just:
Maybe my machine can't handle it. |
@tritonas00 That looks like you're out of memory, try on smaller map and I'll add exception-check code to make sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work fine
Ok cells show fine in auriga, can you try on f1 testtrack? Probably im out of gpu memory
|
Well, duh, it's a meshed map, so it's covered entirely in debug meshes. Heck, I'll stop being lazy and do the thing in DearIMGUI. |
Meh its fine, my integrated intel gpu just can't handle it |
No crash now 👍 |
Current "Debug Collisions" overlay (cvar 'diag_debug_collisions') is non-interactive, laggy and with hard-to-read text labels.
The new CollisionsDebugUI allows enabling/disabling the overlays interactively and draws labels using DearIMGUI (like net labels.)

Changes: