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

Allow not overwriting entity visibility with debug renderer #470

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dentosal
Copy link

Objective

Currently PhysicsDebugPlugin always overwrites Visibility component of the entity with Collider. This is sometimes undesirable, as I want to have entities whose visibilty is part of the game logic.

Solution

This PR allows the debug renderer to instead not overwrite the visibilty when configured to do so. The PR also changes the default value to not overwrite, as it always forced colliders to be visibile before.

Alternatives

An Option<Visibility> could be used instead of an enum, but I hope this version is more readable. We could also just not change visibility if hide_meshes is set to false, but this would unexpectedly affect visibility if this is toggled.


Changelog

This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section.

  • What changed as a result of this PR?
  • If applicable, organize changes under "Added", "Changed", or "Fixed" sub-headings
  • Stick to one or two sentences. If more detail is needed for a particular change, consider adding it to the "Solution" section
    • If you can't summarize the work, your change may be unreasonably large / unrelated. Consider splitting your PR to make it easier to review and merge!

Migration Guide

The hide_meshes: bool field of PhysicsGizmos (global) and DebugRender (entity) has been replaced with mesh_visibility: MeshVisibility. The old value false should be MeshVisibility::Overwrite(Visibility::Visible), and true should be MeshVisibility::Overwrite(Visibility::Hidden).

The debug renderer no longer forces entities with Collider to be visible by default To restore old behavior, we have to set the mesh_visibility field to one of the variants described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant