Function ecs_get_object

Synopsis

#include <include/flecs.h>

FLECS_API ecs_entity_t ecs_get_object(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, int32_t index)

Description

Get the object of a relation. This will return a object of the entity for the specified relation. The index allows for iterating through the objects, if a single entity has multiple objects for the same relation.

If the index is larger than the total number of instances the entity has for the relation, the operation will return 0.

Parameters

world - The world.

entity - The entity.

rel - The relation between the entity and the object.

index - The index of the relation instance.

Returns
The object for the relation at the specified index.

Mentioned in

Source

Line 1992 in include/flecs.h.