|
Anvil Engine
|
Represents an entity in the game engine with position, rotation, scale and components. More...
#include <AEntity.h>
Public Member Functions | |
| void | AddComponent (IComponent *comp) |
| Adds a component to the entity and initializes it. | |
| template<typename T> | |
| T * | GetComponent () |
| Gets a specific component by type. | |
| const std::vector< IComponent * > & | GetComponents () const |
| Gets all components attached to this entity. | |
| void | Update (float dt) |
| Updates all components attached to this entity. | |
| ~AEntity () | |
| Destructor that cleans up all attached components. | |
Public Attributes | |
| std::string | name |
| glm::vec3 | position = glm::vec3(0.0f) |
| glm::vec3 | rotation = glm::vec3(0.0f) |
| glm::vec3 | scale = glm::vec3(1.0f) |
Represents an entity in the game engine with position, rotation, scale and components.
Represents a basic entity in the game engine, which can hold components and has transform properties.
|
inline |
Destructor that cleans up all attached components.
|
inline |
Adds a component to the entity and initializes it.
| comp | Pointer to the component to be added |
|
inline |
Gets a specific component by type.
| T | Type of the component to retrieve |
|
inline |
Gets all components attached to this entity.
|
inline |
Updates all components attached to this entity.
| dt | Delta time for frame-independent updates |
| std::string AEntity::name |
| glm::vec3 AEntity::position = glm::vec3(0.0f) |
| glm::vec3 AEntity::rotation = glm::vec3(0.0f) |
| glm::vec3 AEntity::scale = glm::vec3(1.0f) |