Function ecs_term_source


#include <include/flecs.h>

FLECS_API ecs_entity_t ecs_term_source(const ecs_iter_t *it, int32_t index)


Obtain the source for a term. This operation retrieves the source of the specified term. A source is the entity from which the data is retrieved. If the term is owned by the iterated over entity/entities, the function will return id 0.

This operation can be useful to retrieve, for example, the id of a parent entity when a component from a parent has been requested, or to retrieve the id from a prefab, in the case of a shared component.


it - The iterator.

index - The index of the term in the query.

The source associated with te term.


Line 2500 in include/flecs.h.