Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Scene::Entity Class Reference

An entity is an scene element. It ties together components with a transform. More...

#include <Engine/Scene/Entity.hpp>

+ Inheritance diagram for Ra::Engine::Scene::Entity:
+ Collaboration diagram for Ra::Engine::Scene::Entity:

Public Member Functions

 Entity (const std::string &name="")
 
 Entity (const Entity &entity)=delete
 
Entityoperator= (const Entity &)=delete
 
const std::stringgetName () const
 
void rename (const std::string &name)
 
void setTransform (const Core::Transform &transform)
 
void setTransform (const Core::Matrix4 &transform)
 
const Core::Transform & getTransform () const
 
const Core::Matrix4 & getTransformAsMatrix () const
 
void swapTransformBuffers ()
 
Core::Utils::Observable< const Entity * > & transformationObservers () const
 get a ref to transformation observers to add/remove an observer
 
void addComponent (Component *component)
 Add a component to the given entity. Component ownership is transfered to the entity.
 
void removeComponent (const std::string &name)
 Deletes a component with a given name.
 
ComponentgetComponent (const std::string &name)
 Get component with a given name.
 
const ComponentgetComponent (const std::string &name) const
 
const std::vector< std::unique_ptr< Component > > & getComponents () const
 
uint getNumComponents () const
 Get component belonging to a given system.
 
virtual Core::Aabb computeAabb ()
 
void invalidateAabb ()
 
- Public Member Functions inherited from Ra::Core::Utils::IndexedObject
 IndexedObject (Index idx=Index::Invalid())
 CONSTRUCTOR.
 
 IndexedObject (const IndexedObject &id_obj)=default
 
void setIndex (const Index &idx)
 
const Index & getIndex () const
 

Additional Inherited Members

- Protected Attributes inherited from Ra::Core::Utils::IndexedObject
Index m_idx
 VARIABLE.
 

Detailed Description

An entity is an scene element. It ties together components with a transform.

Definition at line 22 of file Entity.hpp.

Constructor & Destructor Documentation

◆ Entity()

Ra::Engine::Scene::Entity::Entity ( const std::string & name = "")
explicit

Definition at line 12 of file Entity.cpp.

◆ ~Entity()

Ra::Engine::Scene::Entity::~Entity ( )
override

Definition at line 18 of file Entity.cpp.

Member Function Documentation

◆ addComponent()

void Ra::Engine::Scene::Entity::addComponent ( Component * component)

Add a component to the given entity. Component ownership is transfered to the entity.

Definition at line 26 of file Entity.cpp.

+ Here is the call graph for this function:

◆ computeAabb()

Core::Aabb Ra::Engine::Scene::Entity::computeAabb ( )
virtual

Definition at line 78 of file Entity.cpp.

◆ getComponent() [1/2]

Component * Ra::Engine::Scene::Entity::getComponent ( const std::string & name)

Get component with a given name.

Definition at line 40 of file Entity.cpp.

+ Here is the call graph for this function:

◆ getComponent() [2/2]

const Component * Ra::Engine::Scene::Entity::getComponent ( const std::string & name) const

Definition at line 48 of file Entity.cpp.

◆ getComponents()

const std::vector< std::unique_ptr< Component > > & Ra::Engine::Scene::Entity::getComponents ( ) const

Definition at line 55 of file Entity.cpp.

◆ getName()

const std::string & Ra::Engine::Scene::Entity::getName ( ) const
inline

Definition at line 89 of file Entity.hpp.

◆ getNumComponents()

uint Ra::Engine::Scene::Entity::getNumComponents ( ) const
inline

Get component belonging to a given system.

Definition at line 118 of file Entity.hpp.

◆ getTransform()

const Core::Transform & Ra::Engine::Scene::Entity::getTransform ( ) const
inline

Definition at line 106 of file Entity.hpp.

◆ getTransformAsMatrix()

const Core::Matrix4 & Ra::Engine::Scene::Entity::getTransformAsMatrix ( ) const
inline

Definition at line 112 of file Entity.hpp.

◆ invalidateAabb()

void Ra::Engine::Scene::Entity::invalidateAabb ( )

Definition at line 94 of file Entity.cpp.

◆ removeComponent()

void Ra::Engine::Scene::Entity::removeComponent ( const std::string & name)

Deletes a component with a given name.

Definition at line 59 of file Entity.cpp.

+ Here is the call graph for this function:

◆ rename()

void Ra::Engine::Scene::Entity::rename ( const std::string & name)
inline

Definition at line 93 of file Entity.hpp.

◆ setTransform() [1/2]

void Ra::Engine::Scene::Entity::setTransform ( const Core::Matrix4 & transform)
inline

Definition at line 102 of file Entity.hpp.

◆ setTransform() [2/2]

void Ra::Engine::Scene::Entity::setTransform ( const Core::Transform & transform)
inline

Definition at line 97 of file Entity.hpp.

◆ swapTransformBuffers()

void Ra::Engine::Scene::Entity::swapTransformBuffers ( )

Definition at line 70 of file Entity.cpp.

◆ transformationObservers()

Core::Utils::Observable< const Entity * > & Ra::Engine::Scene::Entity::transformationObservers ( ) const
inline

get a ref to transformation observers to add/remove an observer

Definition at line 122 of file Entity.hpp.


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