How can I use Flecs query to support the iteration for std algorithms? #900
Answered
by
SanderMertens
undersilence
asked this question in
Q&A
-
Currently I am working on writing a physics simulator using auto Q = world.query<Position, Velocity, Force>();
for(auto it = Q.begin(); it != Q.end(); ++it) {
auto& [p, v, f] = *it; // Position& p, Velocity& v, Force& f
...
} So that I can access the result of the query as it was a container. I notice that |
Beta Was this translation helpful? Give feedback.
Answered by
SanderMertens
Jan 7, 2023
Replies: 1 comment
-
Yeah an interface like that would be useful. Not sure when I'll get to it, but I'll look into it! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
undersilence
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah an interface like that would be useful. Not sure when I'll get to it, but I'll look into it!