Function ecs_record_get_id

Synopsis

#include <include/flecs.h>

FLECS_API const void * ecs_record_get_id(ecs_world_t *world, const ecs_record_t *record, ecs_id_t id)

Description

Get component from entity record. This operation returns a pointer to a component for the entity associated with the provided record. For safe access to the component, obtain the record with ecs_read_begin or ecs_write_begin.

Obtaining a component from a record is faster than obtaining it from the entity handle, as it reduces the number of lookups required.

Parameters

world - The world.

record - Record to the entity.

id - The (component) id.

Returns
Pointer to component, or NULL if entity does not have the component.

Source

Line 2040 in include/flecs.h.