-
I didn't found any examples nor documentation about that, but how could I grab a pair with system terms conf, something like :
Or is there another clean way for that ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
How to deal with relationship pairs is explained in the Queries section, specifically Pairs. If you want to match a specific pair: .query.filter.terms = {
{ ecs_id(position_t) },
{ ecs_pair(ecs_id(controller_t), ecs_id(ai_t)) },
}, If you want to match every controller: .query.filter.terms = {
{ ecs_id(position_t) },
{ ecs_pair(ecs_id(controller_t), EcsWildcard)) },
}, This will match the same entity multiple times for each wildcard matched. ecs_id_t ctrl_pair = ecs_field_id(&it, 2); // index = 1 is position, 2 would be the controller pair
ecs_entity_t second = ecs_pair_second(world, ctrl_pair); Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
That's fine, sorry I thought that those terms weren't suitable for systems, I didn't understood correctly the doc. |
Beta Was this translation helpful? Give feedback.
-
ok so I actually supposed I could do and ecs_get in my system callback, seems to not be the correct operation, knowing that I already defined the input_t struct globally (just in case) :
|
Beta Was this translation helpful? Give feedback.
How to deal with relationship pairs is explained in the Queries section, specifically Pairs.
If you want to match a specific pair:
If you want to match every controller:
This will match the same entity multiple times for each wildcard matched.
And you can get the matched target like this from the iterator:
Hope this helps.