Radium Engine  1.5.20
Loading...
Searching...
No Matches
SystemDisplay.cpp
1#include <Engine/Rendering/RenderObjectManager.hpp>
3namespace Ra {
4namespace Engine {
5namespace Scene {
6
7SystemEntity::SystemEntity() : Entity( "System Display Entity" ) {
8 /*
9 addComponent(new UiComponent(nullptr));
10 addComponent(new DebugComponent(nullptr));
11 */
12 new UiComponent( this );
13 new DebugComponent( this );
14}
15
16UiComponent* SystemEntity::uiCmp() {
17 SystemEntity* instance = getInstance();
18 CORE_ASSERT( instance->getTransformAsMatrix() == Core::Matrix4::Identity(),
19 "Transform has been changed !" );
20 return static_cast<UiComponent*>( instance->getComponent( "UI" ) );
21}
22
23#ifndef RA_DISABLE_DEBUG_DISPLAY
24DebugComponent* SystemEntity::dbgCmp() {
25 SystemEntity* instance = getInstance();
26 CORE_ASSERT( instance->getTransformAsMatrix() == Core::Matrix4::Identity(),
27 "Transform has been changed !" );
28 return static_cast<DebugComponent*>( instance->getComponent( "Debug" ) );
29}
30
31Rendering::RenderObject* DebugComponent::getRenderObject( Core::Utils::Index idx ) {
32 return getRoMgr()->getRenderObject( idx ).get();
33}
34#endif
35
36RA_SINGLETON_IMPLEMENTATION( SystemEntity );
37
38} // namespace Scene
39} // namespace Engine
40} // namespace Ra
Component for debug drawing.
Component * getComponent(const std::string &name)
Get component with a given name.
Definition Entity.cpp:40
Component for UI drawing.
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3