-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Per entity/collider debug rendering #278
Conversation
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.
Looks like it would work, but it could use a little bit of cleanup.
Is there any way to elevate "draw only entities with ColliderDebug
components" to a system, and have a global system and a selective one, and bail out at the start of either, instead of doing this per-line?
self.global || self.visible.contains(entity) | ||
}) | ||
.unwrap_or(false), | ||
_ => true, |
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.
Does this _ => true
imply that only collider rendering can ever be disabled per-entity, and everything else remains on?
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.
Well that's what I'm using at the moment, colliders only, so I wasn't even sure if joints are rendered ? And for the bodies, I guess it's only the axes thing that is rendered. But what is DebugRenderObject::Other ?.. And how would I render joints, only if two bodies are marked as debug-visible ? Or any of two bodies is enough to be rendered
I think no, there is no way. Well I don't see any, since rendering is done by |
Overall a good idea/impl imo :) I think adding a per-entity "DebugRenderMode" would be useful in the future as well, but I think getting this in first would be preferable. |
I have updated this PR once again, I wonder if anything is blocking this PR from being merged ? Would really like to get this feature into the library ! |
4e8abaf
to
3f6ca06
Compare
Thanks for the pull request! I like it overall, I, too, would have appreciated a more customizable approach, to more easily switching from different modes/selection, maybe bevyengine/bevy#7328 is interesting to take inspiration from it. In the meanwhile, this is an acceptable implementation for me. An example and changelog would be great ! |
I initially based this PR on how |
3f6ca06
to
64b2ce0
Compare
@Vrixyz I've rewrote this PR to mirror bevy's |
Thanks! |
I needed a way to toggle debug rendering of colliders for group of entities in my project, so I thought of implementing it kind of like bevy
Wireframe
works, with global flag in resource, and if it's off, then per entity with marker component. I also considered just usingVisibility
for collider entities, but that's seems unintuitive.Oh, I also fixed(fixed in recent master)RapierDebugRenderPlugin::enabled
not being used, I'm not sure if creating context withenabled: true
was intentional or just a typo.