-
Notifications
You must be signed in to change notification settings - Fork 15
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 traits to be filtered by Added/Changed #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far.
pub struct ChangeDetectionFetch<'w, Trait: ?Sized + TraitQuery> { | ||
registry: &'w TraitImplRegistry<Trait>, | ||
table_ticks: Vec<ThinSlicePtr<'w, UnsafeCell<ComponentTicks>>>, | ||
sparse_components: Vec<&'w ComponentSparseSet>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like allocating here. Pending benchmarks, its probably faster to just iterate over the registered components and look them up in fetch
, rather than caching it on the heap. The All
iterators work this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoJoJet sounds good!
Co-authored-by: JoJoJet <21144246+JoJoJet@users.noreply.github.com>
Implements
Added/Changed
functionality for bevy-trait-query!Closes: #23
What is needed to for this to go out of draft status:
add change detection tests
update documentation to show how change detection should be used