|
0.46.0
|
#include <iEntity.h>
Public Member Functions | |
| const iEntityID & | getID () const |
| iEntityIDPath | getIDPath () const |
| void | setName (const iaString &name) |
| const iaString & | getName () const |
| void | setParent (const iEntityID &parentID) |
| void | setParent (iEntityPtr parent) |
| void | removeParent () |
| iEntityPtr | getParent () const |
| bool | hasParent () const |
| bool | isRoot () const |
| const std::vector< iEntityPtr > & | getChildren () const |
| const std::vector< iEntityPtr > & | getInactiveChildren () const |
| void | setActive (bool active) |
| void | setActiveExclusive (bool active) |
| bool | isActive () const |
| iEntityScenePtr | getScene () const |
| iEntityComponentMask | getComponentMask () const |
| template<typename T > | |
| T * | addComponent (T *component) |
| void | addComponent (const std::type_index &typeID, iEntityComponentPtr component) |
| template<typename T > | |
| T * | getComponent () const |
| iEntityComponentPtr | getComponent (const std::type_index &typeID) const |
| const std::vector< std::type_index > | getComponentTypes () |
| template<typename T > | |
| void | destroyComponent () |
| template<typename T > | |
| void | reloadComponent () |
| void | addScript (const iScriptDelegate &script) |
| void | addScript (const iScriptPtr script) |
| void | removeScript (const iScriptDelegate &script) |
| void | clearComponents () |
| bool | isHierarchyDirty () const |
| void | setDirtyHierarchy () |
| void | resetDirtyHierarchy () |
| template<typename T > | |
| T * | addComponent (T *component) |
| template<typename T > | |
| T * | getComponent () const |
| template<typename T > | |
| void | destroyComponent () |
| template<typename T > | |
| void | reloadComponent () |
Static Public Member Functions | |
| static iEntityComponentMask | calcComponentMask (const std::vector< std::type_index > &types) |
Friends | |
| class | iEntityScene |
| class | iEntityTransformTraverser |
| class | iTransformComponent |
entity definition
Igor uses the terms entity, component and system but it is not a classic entity component system or ECS. An entity is a hierarchical element in the scene with parents and children. It behaves more like a game object.
| void igor::iEntity::addComponent | ( | const std::type_index & | typeID, |
| iEntityComponentPtr | component | ||
| ) |
adds component with given type id
entity takes ownership of component
| typeID | the given type id |
| component | the component to add |
| T * igor::iEntity::addComponent | ( | T * | component | ) |
add component
entity takes ownership of component
| component | the component to add |
| T * igor::iEntity::addComponent | ( | T * | component | ) |
| void igor::iEntity::addScript | ( | const iScriptDelegate & | script | ) |
adds script to entity
| script | the script delegate to be added |
| name | the name of the script |
| void igor::iEntity::addScript | ( | const iScriptPtr | script | ) |
adds script script to entity
| script | the script script to be added |
| name | the name of the script |
|
static |
calculate type hash from component types
| types | the types to use for calculation |
| void igor::iEntity::clearComponents | ( | ) |
removes all components
| void igor::iEntity::destroyComponent | ( | ) |
destroys given component by type
| void igor::iEntity::destroyComponent | ( | ) |
| const std::vector< iEntityPtr > & igor::iEntity::getChildren | ( | ) | const |
| T * igor::iEntity::getComponent | ( | ) | const |
| T * igor::iEntity::getComponent | ( | ) | const |
| iEntityComponentPtr igor::iEntity::getComponent | ( | const std::type_index & | typeID | ) | const |
| typeID | the given type |
| iEntityComponentMask igor::iEntity::getComponentMask | ( | ) | const |
| const std::vector< std::type_index > igor::iEntity::getComponentTypes | ( | ) |
| const iEntityID & igor::iEntity::getID | ( | ) | const |
| iEntityIDPath igor::iEntity::getIDPath | ( | ) | const |
This is slow. Use with care
| const std::vector< iEntityPtr > & igor::iEntity::getInactiveChildren | ( | ) | const |
| const iaString & igor::iEntity::getName | ( | ) | const |
| iEntityPtr igor::iEntity::getParent | ( | ) | const |
| iEntityScenePtr igor::iEntity::getScene | ( | ) | const |
| bool igor::iEntity::hasParent | ( | ) | const |
| bool igor::iEntity::isActive | ( | ) | const |
| bool igor::iEntity::isHierarchyDirty | ( | ) | const |
| bool igor::iEntity::isRoot | ( | ) | const |
used for special case handling
| void igor::iEntity::reloadComponent | ( | ) |
destroys given component by type
| void igor::iEntity::reloadComponent | ( | ) |
| void igor::iEntity::removeParent | ( | ) |
removes parent connection
| void igor::iEntity::removeScript | ( | const iScriptDelegate & | script | ) |
removes script from entity
| script | the script to be removed |
| void igor::iEntity::resetDirtyHierarchy | ( | ) |
resets dirty flag on this entity
| void igor::iEntity::setActive | ( | bool | active | ) |
sets wether and entity is active or not
| active | if true entity will be active |
| void igor::iEntity::setActiveExclusive | ( | bool | active | ) |
sets wether and entity is active or not while at the same time make sure all siblings will be set to the opposite
| active | if true entity will be active |
| void igor::iEntity::setDirtyHierarchy | ( | ) |
sets dirty flag up and down the hierarchy
| void igor::iEntity::setName | ( | const iaString & | name | ) |
sets name of entity
| name | the name to set |
| void igor::iEntity::setParent | ( | const iEntityID & | parentID | ) |
sets parent of this entity by id
| parentID | the given parent id |
| void igor::iEntity::setParent | ( | iEntityPtr | parent | ) |
sets parent of this entity
| parent | the given parent |
|
friend |
|
friend |
|
friend |