Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CEntityGroup Class Reference

The object class is designed to optimize entity queries. More...

#include <Entity/CEntityGroup.h>

Inheritance diagram for Skylicht::CEntityGroup:
Skylicht::CGroupComponent Skylicht::CGroupMesh Skylicht::CGroupSkinnedInstancing Skylicht::CGroupTransform Skylicht::CGroupVisible

Public Member Functions

 CEntityGroup (const u32 *dataTypes, int count)
 CEntityGroup (const u32 *dataTypes, int count, CEntityGroup *parentGroup)
virtual void onQuery (CEntityManager *entityManager, CEntity **entities, int numEntity)
CEntity ** getEntities ()
int getEntityCount ()
void notifyNeedQuery ()
bool needQuery ()
bool needValidate ()
void finishValidate ()
bool haveDataType (u32 type)
CEntityGroup * getParent ()

Protected Attributes

core::array< u32 > m_dataTypes
CEntityGroup * m_parentGroup
bool m_needQuery
bool m_needValidate
CFastArray< CEntity * > m_entities

Detailed Description

The object class is designed to optimize entity queries.

CGroupEntity will store query results; however, in some cases, it will re-query, such as when an entity is created or destroyed by CEntityManager, or when the notifyNeedQuery method is called.

Example of creating a group, that only queries entities containing CPrimiviteData.

const u32 primitive[] = GET_LIST_ENTITY_DATA(CPrimiviteData);
CEntityGroup* group = entityManager->createGroup(primitive, 1);
Definition CPrimiviteData.h:35

This method also creates a group that queries entities with CPrimiviteData, but only if those entities are visible (visible = true)

const u32 primitive[] = GET_LIST_ENTITY_DATA(CPrimiviteData);
CEntityGroup* group = entityManager->createGroupFromVisible(primitive, 1);

The documentation for this class was generated from the following file: