3 #include <Engine/RaEngine.hpp>
11 #include <Core/Utils/Color.hpp>
12 #include <Core/Utils/Singleton.hpp>
14 #include <Engine/Scene/Component.hpp>
15 #include <Engine/Scene/Entity.hpp>
17 #ifndef RA_DISABLE_DEBUG_DISPLAY
18 # include <Engine/Data/DrawPrimitives.hpp>
25 #ifndef RA_DISABLE_DEBUG_DISPLAY
61 #ifndef RA_DISABLE_DEBUG_DISPLAY
74 #ifndef RA_DISABLE_DEBUG_DISPLAY
76 # define RA_DISPLAY_POINT( p, color, scale ) \
77 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
78 Ra::Engine::Data::DrawPrimitives::Primitive( \
79 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
80 Ra::Engine::Data::DrawPrimitives::Point( p, color, scale ) ) )
82 # define RA_DISPLAY_VECTOR( p, v, color ) \
83 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
84 Ra::Engine::Data::DrawPrimitives::Primitive( \
85 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
86 Ra::Engine::Data::DrawPrimitives::Vector( p, v, color ) ) )
88 # define RA_DISPLAY_RAY( r, color ) \
89 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
90 Ra::Engine::Data::DrawPrimitives::Primitive( \
91 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
92 Ra::Engine::Data::DrawPrimitives::Ray( r, color ) ) )
94 # define RA_DISPLAY_CIRCLE( c, n, r, color ) \
95 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
96 Ra::Engine::Data::DrawPrimitives::Primitive( \
97 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
98 Ra::Engine::Data::DrawPrimitives::Circle( c, n, r, 20, color ) ) )
100 # define RA_DISPLAY_TRIANGLE( a, b, c, color ) \
101 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
102 Ra::Engine::Data::DrawPrimitives::Primitive( \
103 Ra::Engine::SystemEntity::dbgCmp(), \
104 Ra::Engine::Data::DrawPrimitives::Triangle( a, b, c, color ) ) )
106 # define RA_DISPLAY_NORMAL( p, n, color, scale ) \
107 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
108 Ra::Engine::Scene::DrawPrimitives::Primitive( \
109 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
110 Ra::Engine::Scene::DrawPrimitives::Normal( p, n, color, scale ) ) )
112 # define RA_DISPLAY_FRAME( t, scale ) \
113 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
114 Ra::Engine::Data::DrawPrimitives::Primitive( \
115 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
116 Ra::Engine::Data::DrawPrimitives::Frame( t, scale ) ) )
118 # define RA_DISPLAY_AABB( a, color ) \
119 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
120 Ra::Engine::Data::DrawPrimitives::Primitive( \
121 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
122 Ra::Engine::Data::DrawPrimitives::AABB( a, color ) ) )
124 # define RA_DISPLAY_OBB( a, color ) \
125 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
126 Ra::Engine::Data::DrawPrimitives::Primitive( \
127 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
128 Ra::Engine::Data::DrawPrimitives::OBB( a, color ) ) )
130 # define RA_DISPLAY_SPHERE( c, r, color ) \
131 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
132 Ra::Engine::Data::DrawPrimitives::Primitive( \
133 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
134 Ra::Engine::Data::DrawPrimitives::Sphere( c, r, color ) ) )
136 # define RA_DISPLAY_CAPSULE( p1, p2, r, color ) \
137 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
138 Ra::Engine::Data::DrawPrimitives::Primitive( \
139 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
140 Ra::Engine::Data::DrawPrimitives::Capsule( p1, p2, r, color ) ) )
142 # define RA_DISPLAY_LINE( a, b, color ) \
143 Ra::Engine::Scene::SystemEntity::dbgCmp()->addRenderObject( \
144 Ra::Engine::Data::DrawPrimitives::Primitive( \
145 Ra::Engine::Scene::SystemEntity::dbgCmp(), \
146 Ra::Engine::Data::DrawPrimitives::Line( a, b, color ) ) )
148 # define RA_CLEAR_DEBUG_DISPLAY() \
150 auto cmp = Ra::Engine::Scene::SystemEntity::dbgCmp(); \
151 while ( cmp->m_renderObjects.size() ) { \
152 cmp->removeRenderObject( cmp->m_renderObjects[0] ); \
158 # define RA_DISPLAY_POINT( p, color, scale )
159 # define RA_DISPLAY_VECTOR( p, v, color )
160 # define RA_DISPLAY_RAY( r, color )
161 # define RA_DISPLAY_CIRCLE( c, n, r, color )
162 # define RA_DISPLAY_TRIANGLE( a, b, c, color )
163 # define RA_DISPLAY_NORMAL( p, n, color, scale )
164 # define RA_DISPLAY_FRAME( t, scale )
165 # define RA_DISPLAY_AABB( a, color )
166 # define RA_DISPLAY_OBB( a, color )
167 # define RA_DISPLAY_SPHERE( c, r, color )
168 # define RA_DISPLAY_CAPSULE( p1, p2, r, color )
169 # define RA_DISPLAY_LINE( a, b, color )
170 # define RA_CLEAR_DEBUG_DISPLAY()
A component is an element that can be updated by a system. It is also linked to some other components...
Component for debug drawing.
void initialize() override
Pure virtual method to be overridden by any component. When this method is called you are guaranteed ...
An entity is an scene element. It ties together components with a transform.
Component for UI drawing.
void initialize() override
Pure virtual method to be overridden by any component. When this method is called you are guaranteed ...