Right when the filter component is missing on the client, entities with this component will be hidden. But it's not always desirable. Users may want to express the reverse behavior - make entities visible, unless the client has the filter component.
This requires 2 simple changes to the API:
- Swap order in
is_visible. Make entity filter self and pass client filter as an argument.
- Wrap second argument into
Option.
It's also possible to do it without introducing breaking changes by introducing an associated constant like this:
/// Whether [`Self::Scope`] is visible when this filter component
/// is missing on the client, but present on the entity.
const VISIBLE_WHEN_MISSING: bool = false;
But I think Option is more idiomatic. I plan to implement it after the release for Bevy 0.18.