-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 InvisibleEntities vector [enhancement] [rendering] #518
Comments
Mainly, what bothers me is the condition : It seems like there should be an additional check to render only what is in camera view. This way there won't even be any need to have InvisibleEntities vector. |
I describe a workaround that I think will work in my case : I will create a Resource that will contain a vector of Tiles. Each Tile will contain an enum for tile type (grass, water etc) and a vector of entities to describe who is standing on that tile (for, example, if both flying and walking creatures are allowed on the same tile). Then, I will have a system run constantly and query the camera to compute the corners of camera view. This way I will know the coordinates of tiles (and units on those tiles) to render. As for rendering, I think I will simply add and remove Draw components. I want to mention that I am aware of https://github.com/stararawn/bevy_tiled , but, unless I am wrong, it does not handle units (creatures). And as final words : this is a workaround that works for me because of the design of my game. I think that the Issue should still be considered in case other users need this feature. |
It turned out that the solution I found has already been considered and implemented by others : It is quite similar to what I will develop in terms of tilemap data structure. |
Hey thanks a lot for what you're doing here :) Depending on how we feel about this we might move this into Discussions to have a longer discussion on these improvements |
The new idiom for setting visibility is the |
cameras now have a |
I have looked into https://docs.rs/bevy_render/0.1.3/src/bevy_render/camera/visible_entities.rs.html#26-60
If I understand correctly, this system looks into all entities in camera view and
My suggestion is to add a vector InvisibleEntities to https://docs.rs/bevy/0.1.3/bevy/prelude/struct.Camera2dComponents.html
This vector will contain entities that are in camera view, but have is_visible set as false.
I believe that this would greatly simplify the detection of entities to render or not.
My usecase was that I wanted to render only entities that are in camera view.
Since there is no such vector as InvisibleEntities, I don't see any way to detect whether hidden entities (with is_visible set to false) are in camera view or not.
Obviously, the name of parameter can be different : HiddenEntities, InvisibleEntitiesInCameraView...
This seems related to #190 , but it is not.
The text was updated successfully, but these errors were encountered: