Closed nicopap closed 3 years ago
The error is caused by a clippy flag. I notice the clippy warnings only show up when running with cargo clippy --workspace --all-features
, in fact there is a lot of already existing unfixed clippy lints in the code. I opted to not fix them to restrict the scope of the PR strictly to the debug change. I'll remove the clippy flag and it should be alright.
A few things I need to clear up:
Cool. Thank you very much for your help :-)
I converted the PR to draft. You can mark it "Ready for review" when you are done working on it ;-)
Ok, I gave up on the depth_test toggle. I still think it's useful but it's not ergonomic enough to add it yet. The issue is that you currently must specify it before initializing DebugLinesPlugin
, this is a limitation of the bevy_debug_lines
library.
I refactored the code, now the rounded corners on the cuboids display as rounded corners rather than bevel.
I also fixed the issue with the height maps, turns out its more a series of triangles than a series of squares.
I'll work on pulling edgarssilva's changes tomorrow. And it will be good to go.
Add the "debug-3d" cargo feature. When enabled, we draw the approximate shape of the physics object. The user can chose to toggle "see-through" mode to draw the physics object boundaries in front of everything or with occlusion.
I say "approximate shape" because:
To enable see-through, add the
DebugLines
resource re-exported in heron_debug, setting thedepth_test
field as specified in (1)(1) https://github.com/Toqozz/bevy_debug_lines
Note on the implementation:
The bevy wireframe render mode (2) could replace some of the shape drawing functions. I didn't use it because I learned about it after completing the implementation. But I think it makes sense to not mix usage of wireframe mode and debug-lines.
We expose the
bevy_debug_lines
DebugLines struct in the API, which means we are tightly bound to it, and it would be a breaking change to switch backend for the 3d debug rendering. This is important to consider, event if this is only for debugging. What could be the alternative?(2) https://docs.rs/bevy/0.5.0/bevy/render/wireframe/index.html