igor::iEntityScene Class Reference

#include <iEntityScene.h>

Inherits std::enable_shared_from_this< iEntityScene >.

Public Member Functions

iEntity createEntity (const iaString &name="", bool active=true)
 
void destroyEntity (iEntityID entityID)
 
void destroyEntity (const iEntity &entity)
 
void clear ()
 
template<typename T >
T & addComponent (iEntityID entityID, const T &component)
 
template<typename T >
T & addUserComponent (iEntityID entityID, const T &component)
 
template<typename T >
T & getComponent (iEntityID entityID)
 
template<typename T >
T & getUserComponent (iEntityID entityID)
 
template<typename T >
T * tryGetComponent (iEntityID entityID)
 
template<typename T >
T * tryGetUserComponent (iEntityID entityID)
 
template<typename T >
void removeComponent (iEntityID entityID)
 
void initializeQuadtree (const iaRectangled &box, const uint32 splitThreshold=4, const uint32 maxDepth=16)
 
iQuadtreedgetQuadtree () const
 
bool hasQuadtree () const
 
void * getRegistry () const
 
void setBounds (const iAABoxd &box)
 
const iAABoxdgetBounds () const
 
template<typename T >
T & addComponent (iEntityID entityID, const T &component)
 
template<typename T >
T & getComponent (iEntityID entityID)
 
template<typename T >
T * tryGetComponent (iEntityID entityID)
 
template<typename T >
void removeComponent (iEntityID entityID)
 
template<typename T >
T & addUserComponent (iEntityID entityID, const T &component)
 
template<typename T >
T & getUserComponent (iEntityID entityID)
 
template<typename T >
T * tryGetUserComponent (iEntityID entityID)
 

Friends

class iEntitySystemModule
 
class iEntitySceneDeleter
 

Detailed Description

entity scene

Member Function Documentation

◆ addComponent() [1/2]

template<typename T >
T & igor::iEntityScene::addComponent ( iEntityID  entityID,
const T &  component 
)

adds component to entity

Parameters
componentthe component to add

◆ addComponent() [2/2]

template<typename T >
T & igor::iEntityScene::addComponent ( iEntityID  entityID,
const T &  component 
)

◆ addUserComponent() [1/2]

template<typename T >
T & igor::iEntityScene::addUserComponent ( iEntityID  entityID,
const T &  component 
)

adds custom component to entity

this is meant for types unknown to Igor

Parameters
componentthe component to add

◆ addUserComponent() [2/2]

template<typename T >
T & igor::iEntityScene::addUserComponent ( iEntityID  entityID,
const T &  component 
)

◆ clear()

void igor::iEntityScene::clear ( )

clears the scene

◆ createEntity()

iEntity igor::iEntityScene::createEntity ( const iaString name = "",
bool  active = true 
)

creates an entity

◆ destroyEntity() [1/2]

void igor::iEntityScene::destroyEntity ( const iEntity entity)

destroys an entity

Parameters
entitythe entity to destroy

◆ destroyEntity() [2/2]

void igor::iEntityScene::destroyEntity ( iEntityID  entityID)

destroys an entity by id

Parameters
entityIDthe entity ID

◆ getBounds()

const iAABoxd & igor::iEntityScene::getBounds ( ) const
Returns
global bounds

◆ getComponent() [1/2]

template<typename T >
T & igor::iEntityScene::getComponent ( iEntityID  entityID)
Returns
reference to component for given entity
Parameters
entityIDthe given entity

◆ getComponent() [2/2]

template<typename T >
T & igor::iEntityScene::getComponent ( iEntityID  entityID)

◆ getQuadtree()

iQuadtreed & igor::iEntityScene::getQuadtree ( ) const
Returns
internal quadtree

◆ getRegistry()

void * igor::iEntityScene::getRegistry ( ) const
Returns
entt registry

◆ getUserComponent() [1/2]

template<typename T >
T & igor::iEntityScene::getUserComponent ( iEntityID  entityID)
Returns
reference to custom component of given entity
Parameters
componentthe component to add

◆ getUserComponent() [2/2]

template<typename T >
T & igor::iEntityScene::getUserComponent ( iEntityID  entityID)

◆ hasQuadtree()

bool igor::iEntityScene::hasQuadtree ( ) const
Returns
true if quadtree present

◆ initializeQuadtree()

void igor::iEntityScene::initializeQuadtree ( const iaRectangled box,
const uint32  splitThreshold = 4,
const uint32  maxDepth = 16 
)

initialize quadtree

Parameters
boxvolume of the whole quadtree
splitThresholdthreshold count of objects on a node before splitting the node
maxDepththe maximum depth of the tree

◆ removeComponent() [1/2]

template<typename T >
void igor::iEntityScene::removeComponent ( iEntityID  entityID)

removes component of given entity with given type

◆ removeComponent() [2/2]

template<typename T >
void igor::iEntityScene::removeComponent ( iEntityID  entityID)

◆ setBounds()

void igor::iEntityScene::setBounds ( const iAABoxd box)

sets global bounds

◆ tryGetComponent() [1/2]

template<typename T >
T * igor::iEntityScene::tryGetComponent ( iEntityID  entityID)
Returns
pointer to component for given entity. nullptr if component does not exist
Parameters
entityIDthe given entity

◆ tryGetComponent() [2/2]

template<typename T >
T * igor::iEntityScene::tryGetComponent ( iEntityID  entityID)

◆ tryGetUserComponent() [1/2]

template<typename T >
T * igor::iEntityScene::tryGetUserComponent ( iEntityID  entityID)
Returns
pointer to custom component for given entity. nullptr if component does not exist
Parameters
entityIDthe given entity

◆ tryGetUserComponent() [2/2]

template<typename T >
T * igor::iEntityScene::tryGetUserComponent ( iEntityID  entityID)

Friends And Related Function Documentation

◆ iEntitySceneDeleter

friend class iEntitySceneDeleter
friend

◆ iEntitySystemModule

friend class iEntitySystemModule
friend

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