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

This is the object class that describes an entity. More...

#include <Entity/CEntity.h>

Public Member Functions

 CEntity (CEntityManager *mgr)
 CEntity (CEntityPrefab *mgr)
void remove ()
template<class T>
T * addData ()
template<class T>
T * addData (int index)
IEntityDataaddDataByActivator (const char *dataType)
CEntityManager * getEntityManager ()
int getDataCount ()
IEntityDatagetDataByIndex (u32 dataIndex)
void setID (const char *id)
std::string & getID ()
template<class T>
T * getData ()
template<class T>
bool removeData ()
bool removeData (u32 index)
void removeAllData ()
int getIndex ()
bool isAlive ()
bool isVisible ()
void setVisible (bool b)
void notifyUpdateGroup (int type)

Public Attributes

IEntityDataData [MAX_ENTITY_DATA]

Protected Member Functions

void setAlive (bool b)

Protected Attributes

bool m_visible
bool m_alive
int m_index
std::string m_id
CEntityManager * m_mgr

Friends

class CEntityManager
class CEntityPrefab

Detailed Description

This is the object class that describes an entity.

The image shows a scene's structure featuring many GameObjects and Entity

Within an entity, various types of data (IEntityData) will be stored. Example: CWorldTransformData, CVisibleData, CCullingData, CRenderMeshData...

Use the GET_ENTITY_DATA macro to retrieve the Data object attached to the Entity.

CEntity* entity = gameObject->getEntity();
CWorldTransformData* transform = GET_ENTITY_DATA(entity, CWorldTransformData);
const core::matrix4& worldTransform = transform->World;
Definition CWorldTransformData.h:32

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