-
Notifications
You must be signed in to change notification settings - Fork 43
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
feature request: TraitView #145
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was discussed on Zulip, but isn't being actively worked on at the moment, so opening a tracking issue with @leudz blessing. I have no idea how difficult it would be to add this, might be super hard!
Motivation:
Let's say we're building a renderer where we don't know all the possible variants of the meshes/materials, but we do know they satisfy a certain interface. It would be wonderful to do something like this:
This is doable without any heap allocation in an application by having the Mesh/Material be enums, though this requires all the variants be defined in a rigid manner.
If the above renderer were used as a library, then downstream code could merely add Mesh and Material components that satisfy the trait. Much more flexible!
Prior art:
https://github.com/BoxyUwU/bevy_unofficial_trait_queries
The text was updated successfully, but these errors were encountered: