Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Scene::Component Class Referenceabstract

A component is an element that can be updated by a system. It is also linked to some other components in an entity. Each component share a transform through their entity. More...

#include <Engine/Scene/Component.hpp>

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

Public Member Functions

 Component (const std::string &name, Entity *entity)
 CONSTRUCTOR.
 
virtual ~Component ()
 DESTRUCTOR.
 
virtual void initialize ()=0
 Pure virtual method to be overridden by any component. When this method is called you are guaranteed that all other startup systems have been loaded.
 
virtual void setEntity (Entity *entity)
 Set entity the component is part of. This method is called by the entity.
 
virtual EntitygetEntity () const
 Return the entity the component belongs to.
 
virtual const std::stringgetName () const
 Return the component's name.
 
virtual void setSystem (System *system)
 Set the system to which the component belongs.
 
virtual SystemgetSystem () const
 Returns the system to which the component belongs.
 
Core::Utils::Index addRenderObject (Rendering::RenderObject *renderObject)
 Add a new render object to the component. This adds the RO to the manager for drawing.
 
void removeRenderObject (const Core::Utils::Index &roIdx)
 Remove the render object from the component.
 
virtual bool canEdit (const Core::Utils::Index &) const
 Returns true if a transform can be edited with the render object index given as a key.
 
virtual Core::Transform getTransform (const Core::Utils::Index &) const
 Get the transform associated with the given RO index key.
 
virtual void setTransform (const Core::Utils::Index &, const Core::Transform &)
 Set the new transform associated with the RO index key.
 
void notifyRenderObjectExpired (const Core::Utils::Index &idx)
 
virtual Core::Aabb computeAabb ()
 
void invalidateAabb ()
 
const std::vector< Core::Utils::Index > & getRenderObjects ()
 

Public Attributes

std::vector< Core::Utils::Index > m_renderObjects
 

Static Protected Member Functions

static Rendering::RenderObjectManager * getRoMgr ()
 Shortcut to access the render object manager.
 

Protected Attributes

std::string m_name {}
 
Entitym_entity { nullptr }
 
Systemm_system { nullptr }
 

Detailed Description

A component is an element that can be updated by a system. It is also linked to some other components in an entity. Each component share a transform through their entity.

Definition at line 30 of file Component.hpp.

Constructor & Destructor Documentation

◆ Component()

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

CONSTRUCTOR.

Definition at line 20 of file Component.cpp.

+ Here is the call graph for this function:

◆ ~Component()

Ra::Engine::Scene::Component::~Component ( )
virtual

DESTRUCTOR.

Definition at line 25 of file Component.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ addRenderObject()

Core::Utils::Index Ra::Engine::Scene::Component::addRenderObject ( Rendering::RenderObject * renderObject)

Add a new render object to the component. This adds the RO to the manager for drawing.

Definition at line 41 of file Component.cpp.

+ Here is the call graph for this function:

◆ canEdit()

virtual bool Ra::Engine::Scene::Component::canEdit ( const Core::Utils::Index & ) const
inlinevirtual

Returns true if a transform can be edited with the render object index given as a key.

Reimplemented in Ra::Engine::Scene::SkeletonComponent.

Definition at line 76 of file Component.hpp.

◆ computeAabb()

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

Definition at line 63 of file Component.cpp.

◆ getEntity()

virtual Entity * Ra::Engine::Scene::Component::getEntity ( ) const
inlinevirtual

Return the entity the component belongs to.

Definition at line 53 of file Component.hpp.

◆ getName()

virtual const std::string & Ra::Engine::Scene::Component::getName ( ) const
inlinevirtual

Return the component's name.

Definition at line 56 of file Component.hpp.

◆ getRenderObjects()

const std::vector< Core::Utils::Index > & Ra::Engine::Scene::Component::getRenderObjects ( )
inline

Definition at line 94 of file Component.hpp.

◆ getRoMgr()

Rendering::RenderObjectManager * Ra::Engine::Scene::Component::getRoMgr ( )
staticprotected

Shortcut to access the render object manager.

Definition at line 37 of file Component.cpp.

◆ getSystem()

virtual System * Ra::Engine::Scene::Component::getSystem ( ) const
inlinevirtual

Returns the system to which the component belongs.

Definition at line 62 of file Component.hpp.

◆ getTransform()

virtual Core::Transform Ra::Engine::Scene::Component::getTransform ( const Core::Utils::Index & ) const
inlinevirtual

Get the transform associated with the given RO index key.

Reimplemented in Ra::Engine::Scene::SkeletonComponent.

Definition at line 79 of file Component.hpp.

◆ initialize()

virtual void Ra::Engine::Scene::Component::initialize ( )
pure virtual

◆ invalidateAabb()

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

Definition at line 80 of file Component.cpp.

◆ notifyRenderObjectExpired()

void Ra::Engine::Scene::Component::notifyRenderObjectExpired ( const Core::Utils::Index & idx)

Definition at line 57 of file Component.cpp.

◆ removeRenderObject()

void Ra::Engine::Scene::Component::removeRenderObject ( const Core::Utils::Index & roIdx)

Remove the render object from the component.

Definition at line 47 of file Component.cpp.

+ Here is the call graph for this function:

◆ setEntity()

virtual void Ra::Engine::Scene::Component::setEntity ( Entity * entity)
inlinevirtual

Set entity the component is part of. This method is called by the entity.

Parameters
entityThe entity the component is part of.

Definition at line 50 of file Component.hpp.

◆ setSystem()

virtual void Ra::Engine::Scene::Component::setSystem ( System * system)
inlinevirtual

Set the system to which the component belongs.

Definition at line 59 of file Component.hpp.

◆ setTransform()

virtual void Ra::Engine::Scene::Component::setTransform ( const Core::Utils::Index & ,
const Core::Transform &  )
inlinevirtual

Set the new transform associated with the RO index key.

Reimplemented in Ra::Engine::Scene::SkeletonComponent.

Definition at line 84 of file Component.hpp.

Member Data Documentation

◆ m_entity

Entity* Ra::Engine::Scene::Component::m_entity { nullptr }
protected

Definition at line 105 of file Component.hpp.

◆ m_name

std::string Ra::Engine::Scene::Component::m_name {}
protected

Definition at line 104 of file Component.hpp.

◆ m_renderObjects

std::vector<Core::Utils::Index> Ra::Engine::Scene::Component::m_renderObjects

Definition at line 101 of file Component.hpp.

◆ m_system

System* Ra::Engine::Scene::Component::m_system { nullptr }
protected

Definition at line 106 of file Component.hpp.


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