Function ecs_iter_find_column


#include <include/flecs.h>

FLECS_API int32_t ecs_iter_find_column(const ecs_iter_t *it, ecs_id_t id)


Find the column index for a given id. This operation finds the index of a column in the current type for the specified id. For example, if an entity has type Position, Velocity, and the application requests the id for the Velocity component, this function will return 1.

Note that the column index returned by this function starts from 0, as opposed to 1 for the terms. The reason for this is that the returned index is equivalent to using the ecs_type_get_index function, with as type the value returned by ecs_iter_type.

This operation can be used to request columns that are not requested by a query. For example, a query may request Position, Velocity, but an entity may also have Mass. With this function the iterator can request the data for Mass as well, when used in combination with ecs_iter_column.


it - The iterator.

The type of the currently iterated entity/entities.


Line 2574 in include/flecs.h.