Repository navigation
Query Joins - #11535
Query Joins#11535
Conversation
|
This counts as fixing #1658. We can make more detailed issues for more complex and specific needs as they arise. |
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
| world: &World, | ||
| other: &QueryState<OtherD, OtherF>, | ||
| ) -> QueryState<NewD, NewF> { | ||
| let mut component_access = FilteredAccess::default(); |
There was a problem hiding this comment.
Not necessary in this PR, but pre-allocating here might be a good idea.
There was a problem hiding this comment.
yeah, I think there should be a way for this method and transmutes to reuse an existing query state.
|
|
||
| QueryState { | ||
| world_id: self.world_id, | ||
| archetype_generation: self.archetype_generation, |
There was a problem hiding this comment.
We may need to validate that our archetype generation here is identical to that of both the World and the other query.
There was a problem hiding this comment.
Added a warning for when the queries don't have matching id's. I didn't make it a panic as there shouldn't be any safety issues with it and there are probably some niche cases that it would still be valid to do this with mismatching.
I didn't do this for the world. First because it's not available here, but also it's not really valid to call update_archetypes on a QueryState generated from joins or transmutes.
james7132
left a comment
There was a problem hiding this comment.
Looks good to me! Not the biggest fan of hiding QueryState construction, but this is definitely cheaper than calling QueryState::new with the intersection.
f21bc09 to
2c0c481
Compare
alice-i-cecile
left a comment
There was a problem hiding this comment.
I'm happy with this. I'd like to see more user-facing docs about how to use this (probably an example), but I'll punt that to a new issue.
Objective
Query::transmute_lensSolution
Changelog