Skip to content
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

Add enabled flag to PhysicsDebugConfig to globally disable debug rendering at runtime #78

Merged
merged 2 commits into from
Jul 16, 2023

Conversation

LeshaInc
Copy link
Contributor

@LeshaInc LeshaInc commented Jul 16, 2023

This allows easily turning debug renderer on and off by changing enabled field of PhysicsDebugConfig

Also it matches similar approach by GizmoConfig from bevy and DebugRenderContext from rapier.

@Jondolf
Copy link
Owner

Jondolf commented Jul 16, 2023

I wonder if this option should also disable debug rendering for entities with the DebugRender component. It might be useful to be able to disable all debug rendering without having to remove the components.

@Jondolf Jondolf added the C-Enhancement New feature or request label Jul 16, 2023
@LeshaInc
Copy link
Contributor Author

I wonder if this option should also disable debug rendering for entities with the DebugRender component. It might be useful to be able to disable all debug rendering without having to remove the components.

Doesn't it already disable all systems inside the plugin?

@Jondolf
Copy link
Owner

Jondolf commented Jul 16, 2023

I wonder if this option should also disable debug rendering for entities with the DebugRender component. It might be useful to be able to disable all debug rendering without having to remove the components.

Doesn't it already disable all systems inside the plugin?

Oh my bad, it uses a run condition so it doesn't run the systems at all. For some reason I thought it still ran it for entities with DebugRender and skipped the rest, not sure why. But you're right👍

@Jondolf
Copy link
Owner

Jondolf commented Jul 16, 2023

Looks good, I can merge this now

@Jondolf Jondolf merged commit 61e6b20 into Jondolf:main Jul 16, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants