|
Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine. GitHub | Vesper Updates | Creator |
Represents an entity in a scene. More...
#include <Entity.h>
Public Member Functions | |
| Entity ()=default | |
| Entity (entt::entity handle, Scene *scene) | |
| Constructs an Entity with the given handle and scene. | |
| Entity (const Entity &other)=default | |
| Copy constructor for Entity. | |
| template<typename T> | |
| bool | HasComponent () const |
| template<typename T, typename... Args> | |
| T & | AddComponent (Args &&... args) |
| template<typename T, typename... Args> | |
| T & | AddOrReplaceComponent (Args &&... args) |
| template<typename T> | |
| T & | GetComponent () |
| template<typename T, typename... Args> | |
| T & | GetOrAddComponent (Args &&... args) |
| template<typename T> | |
| void | RemoveComponent () |
| const UUID & | GetID () |
| const std::string & | GetName () |
| operator bool () const | |
| operator entt::entity () const | |
| operator uint32_t () const | |
| bool | operator== (const Entity &other) const |
| bool | operator!= (const Entity &other) const |
Private Attributes | |
| entt::entity | m_EntityID {entt::null} |
| The unique identifier of the entity within the scene. | |
| Scene * | m_Scene = nullptr |
| Pointer to the scene that contains the entity. | |
Represents an entity in a scene.
Contains a handle to an entity (entt::entity) in a scene and provides methods to manipulate its components.
|
default |
| Vesper::Entity::Entity | ( | entt::entity | handle, |
| Scene * | scene ) |
Constructs an Entity with the given handle and scene.
| handle | The handle to the entity. |
| scene | The scene to which the entity belongs. |
References Entity(), and m_Scene.
Referenced by Entity().
|
default |
Copy constructor for Entity.
|
inline |
Adds a component of type T to the entity with the provided arguments Otherwise, asserts if the entity already has the component.
| T | The type of component to add. |
| Args | The types of arguments to forward to the component's constructor. |
| args | The arguments to forward to the component's constructor. |
|
inline |
Adds or replaces a component of type T to the entity with the provided arguments.
| T | The type of component to add or replace. |
| Args | The types of arguments to forward to the component's constructor. |
| args | The arguments to forward to the component's constructor. |
|
inline |
Retrieves a reference to the component of type T attached to the entity if it exists. Otherwise, asserts.
| T | The type of component to retrieve. |
|
inline |
|
inline |
Retrieves a const reference to the name of the entity.
|
inline |
Retrieves a reference to the component of type T attached to the entity if it exists. Otherwise, adds the component with the provided arguments and returns it.
| T | The type of component to add. |
| Args | The types of arguments to forward to the component's constructor. |
| args | The arguments to forward to the component's constructor. |
|
inline |
Checks if the entity has a component of type T.
| T | The type of component to check for. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Removes the component of type T from the entity if it exists. Otherwise, asserts.
| T | The type of component to remove. |
|
private |
The unique identifier of the entity within the scene.
|
private |
Pointer to the scene that contains the entity.
Referenced by Entity().