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

#include <Engine/Scene/System.hpp>

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

Public Member Functions

virtual void handleAssetLoading (Entity *entity, const Core::Asset::FileData *data)
 
virtual void generateTasks (Core::TaskQueue *taskQueue, const Engine::FrameInfo &frameInfo)=0
 Pure virtual method to be overridden by any system. Must register in taskQueue the operations that must be done ate each frame.
 
std::vector< Component * > getEntityComponents (const Entity *entity)
 
void addComponent (Entity *entity, Component *component)
 

Protected Member Functions

virtual void registerComponent (const Entity *entity, Component *component)
 
virtual void unregisterComponent (const Entity *entity, Component *component)
 
virtual void unregisterAllComponents (const Entity *entity)
 

Protected Attributes

std::vector< std::pair< const Entity *, Component * > > m_components
 List of active components.
 

Friends

class Component
 

Detailed Description

Systems are responsible of updating a specific subset of the components of each entity. They can provide factory methods to create components, but their main role is to keep a list of "active" components associated to an entity. At each frame, each system loaded into the engine will be queried for tasks. The goal of the tasks is to update the active components during the frame.

Definition at line 30 of file System.hpp.

Member Function Documentation

◆ addComponent()

void Ra::Engine::Scene::System::addComponent ( Entity * entity,
Component * component )
inline

Register an already configured component to the system.

Parameters
entityThe entity owning the component
componentThe component to add to the system
Note
the component is added to the system without any compatibility check.

Definition at line 73 of file System.hpp.

◆ generateTasks()

virtual void Ra::Engine::Scene::System::generateTasks ( Core::TaskQueue * taskQueue,
const Engine::FrameInfo & frameInfo )
pure virtual

Pure virtual method to be overridden by any system. Must register in taskQueue the operations that must be done ate each frame.

Parameters
taskQueueThe queue to fill
frameInfoInformation about the current frame (
See also
FrameInfo)

Implemented in Ra::Engine::Scene::CameraManager, Ra::Engine::Scene::LightManager, and Ra::Engine::Scene::SkeletonBasedAnimationSystem.

◆ getEntityComponents()

std::vector< Component * > Ra::Engine::Scene::System::getEntityComponents ( const Entity * entity)

Returns the components stored for the given entity.

Parameters
entity
Returns
the vector of the entity's components

Definition at line 50 of file System.cpp.

+ Here is the call graph for this function:

◆ handleAssetLoading()

virtual void Ra::Engine::Scene::System::handleAssetLoading ( Entity * entity,
const Core::Asset::FileData * data )
inlinevirtual

Factory method for component creation from file data. From a given file and the corresponding entity, the system will create the corresponding components, add them to the entity, and register the component.

Note
: Issue #325 - As this method register components and might also manage each component outside the m_components vectors (e.g in a buffer on the GPU) the methods, the registerComponent and unregister*Component must be virtual method that could be overriden.

Reimplemented in Ra::Engine::Scene::CameraManager, Ra::Engine::Scene::LightManager, and Ra::Engine::Scene::SkeletonBasedAnimationSystem.

Definition at line 46 of file System.hpp.

◆ registerComponent()

void Ra::Engine::Scene::System::registerComponent ( const Entity * entity,
Component * component )
protectedvirtual

Registers a component belonging to an entity, making it active within the system.

Note
If a system overrides this function, it must call the inherited method.
Parameters
entity
component

Reimplemented in Ra::Engine::Scene::CameraManager, and Ra::Engine::Scene::LightManager.

Definition at line 10 of file System.cpp.

+ Here is the call graph for this function:

◆ unregisterAllComponents()

void Ra::Engine::Scene::System::unregisterAllComponents ( const Entity * entity)
protectedvirtual

Removes all components belonging to a given entity.

Note
If a system overrides this function, it must call the inherited method.
Parameters
entity

Reimplemented in Ra::Engine::Scene::CameraManager, and Ra::Engine::Scene::LightManager.

Definition at line 40 of file System.cpp.

+ Here is the call graph for this function:

◆ unregisterComponent()

void Ra::Engine::Scene::System::unregisterComponent ( const Entity * entity,
Component * component )
protectedvirtual

Unregisters a component. The system will not update it.

Note
If a system overrides this function, it must call the inherited method.
Parameters
entity
component

Reimplemented in Ra::Engine::Scene::CameraManager, and Ra::Engine::Scene::LightManager.

Definition at line 26 of file System.cpp.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ Component

friend class Component
friend

Definition at line 32 of file System.hpp.

Member Data Documentation

◆ m_components

std::vector<std::pair<const Entity*, Component*> > Ra::Engine::Scene::System::m_components
protected

List of active components.

Definition at line 103 of file System.hpp.


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