Some Issues Implementing the Debug Renderer #964
-
Hi there, I'm working on a game in opengl3.3 and I've been trying to implement the debug renderer so that I can see what jolt sees with respect to my game. So far I've built up a project where a player can move around a basic world aim move and jump using Jolt, right now all the rendering is being done manually, and just so happens to line up with what jolt sees for collisions etc... 8mb.video-zU7-pJCHRf50.mp4I'm pretty new to c++ and I tried my best to grasp how 8mb.video-s60-U76RQMlH.mp4What I did was as follows:
The result, as seen in my previous video is a bunch of crazy triangles, which seem to be changing all the time. I would be very grateful if anyone could take a look over my code in Notes:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
I think the biggest problem is that you're storing a pointer to the triangle data that you get passed in: however that data is destructed the moment CreateTriangleBatch returns. You need to create a copy. |
Beta Was this translation helpful? Give feedback.
-
auto lod = inGeometry.GetPtr()->mLODs[0]; |
Beta Was this translation helpful? Give feedback.
-
Hey @jrouwe I was just going back and making sure my project compiles correctly, when I compile my source code (which contains an implementation of the If I don't specify the build type I get the following linker error:
I tried figuring out how to fix this, and I found that in your implementation you have this line: where you include the source file rather than the header file under some specific conditions. When I include that source file (
But I don't believe this is a good workaround. Do you have any idea what's going on here when I don't specify the built type? |
Beta Was this translation helpful? Give feedback.
-
Hey @jrouwe I recently updated my jolt version from this commit: https://github.com/jrouwe/JoltPhysics/tree/ed970874e4d1abbdc1e056fd4ca7f2d487af8b60 to the newest commit, and now I get the following error in my previously working
any hints on why this might have popped up between that commit and now? For more details my debug renderer implementation is here: |
Beta Was this translation helpful? Give feedback.
-
Jolt by default compiles without C++ RTTI, your project is compiling with RTTI. Either turn it off for your own project or turn it on for Jolt using the CPP_RTTI_ENABLED cmake option. |
Beta Was this translation helpful? Give feedback.
I think the biggest problem is that you're storing a pointer to the triangle data that you get passed in:
https://github.com/opengl-toolbox/mwe_physics_world_with_character/blob/c25f6898390d7b48daef7b87b87c6722442a21c8/graphics/physics_debug_renderer/physics_debug_renderer.hpp#L63-L68
however that data is destructed the moment CreateTriangleBatch returns. You need to create a copy.