Skip to content

Reading component of another source in a relationship #1519

Answered by Greu
Greu asked this question in Q&A
Discussion options

You must be logged in to vote

After doing more tests I think I understand the behavior now.

What I was assuming:

  • UpdateDestination is called once per frame
  • count contains the amount of entities that match the query
  • position[i] contains the Position component of the followee for the follower i

How it seems to work:

  • UpdateDestination can be call multiple time per frame, once for each different followee (once for each different relationship subject)
  • count contains the amount of entities that have the same followee (same relationship subject)
  • position contains only one value

Understanding that allowed me to adjust my test and this is now working as intended:

#include <stdio.h>
#include "flecs.h"

typedef struct
{
    d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SanderMertens
Comment options

Answer selected by SanderMertens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants