Function ecs_get_ref_w_id

Synopsis

#include <include/flecs.h>

FLECS_API const void * ecs_get_ref_w_id(const ecs_world_t *world, ecs_ref_t *ref, ecs_entity_t entity, ecs_id_t id)

Description

Get an immutable reference to a component. This operation is similar to ecs_get_id but it stores temporary information in a ecs_ref_t value which allows subsequent lookups to be faster.

Parameters

world - The world.

ref - Pointer to a ecs_ref_t value. Must be initialized.

entity - The entity.

component - The entity id of the component to obtain.

Returns
The component pointer, NULL if the entity does not have the component.

Source

Line 1618 in include/flecs.h.