Closed rsk700 closed 3 days ago
Thanks for the suggestion ! In order to validate a path to implementation, I'd like to discuss current behaviour:
Currently, the testbed demo 2d in javascript provides a rotation gizmo, but I'm not sure where this is originating from, as it's the only example having such debug info 🤔 .
Your are right, there is already rotation gizmo implemented in debug renderer https://docs.rs/rapier2d/latest/rapier2d/pipeline/struct.DebugRenderMode.html#associatedconstant.RIGID_BODY_AXES
But it looks like api to set flag is not exposes in TestbedApp
, flag hard coded here in resource to bevy app:
https://github.com/dimforge/rapier/blob/master/src_testbed/debug_render.rs#L25
and there is no way to change it because resource is private for testbed crate, so question now how to expose those flags to user?
btw I don't see v0.20.0 tag, it looks like it is not tagged in repository, v0.19.0 is the last tag
Thanks for sharing your investigation, that helps! Right now I'm not sure either about how to expose it 😅, I might have ideas when I'll have encountered this codebase more.
I added the tag https://github.com/dimforge/rapier/releases/tag/v0.20.0.
Your suggested patch is fine to me ! It's useful and discreet enough 👍 .
As you volunteered to submit a pull request I'm encouraging you to do so, otherwise I'll adopt it 😄
I'd welcome a comment like "// Draw a line to visualize rotation", because as you noticed this render would have a slightly different behaviour than the others.
Ball 2d collider requires some type of visualization in debug mode for rotations, as it is not possible to see rotations from collider shape itself, here is example I quick hacked:
https://github.com/dimforge/rapier/assets/816292/7156eab0-587a-4ab2-9971-43ca81220a33
I've added radius line in
render_shape
, but it doesn't look like this debug visualization belongs this function, if it is ok, I can submit patch: