Skip to content

Conversation

@Dentosal
Copy link

@Dentosal Dentosal commented Jul 25, 2024

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.


Migration Guide

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

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

@Jondolf Jondolf added C-Feature A new feature, making something new possible A-Debug-Rendering Relates to the debug plugin or any other useful debugging features M-Migration-Guide A breaking change to Avian's public API that needs to be noted in a migration guide labels Dec 8, 2024
@janhohenheim
Copy link
Member

Marking as Waiting-on-Author due to merge conflicts

@janhohenheim janhohenheim added the S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged label Nov 24, 2025
@Dentosal Dentosal force-pushed the debug-render-visibility-config branch from e3798fe to a617cd2 Compare November 25, 2025 00:43
@Dentosal Dentosal force-pushed the debug-render-visibility-config branch from a617cd2 to 1b32479 Compare November 25, 2025 00:46
@Dentosal
Copy link
Author

Marking as Waiting-on-Author due to merge conflicts

Reworked the conflicting segments, should be good to go again

@Jondolf Jondolf added S-Needs-Review Needs reviewer attention to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Debug-Rendering Relates to the debug plugin or any other useful debugging features C-Feature A new feature, making something new possible M-Migration-Guide A breaking change to Avian's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants