MCPcopy Create free account
hub / github.com/carbonengine/trinity / RenderDebugInfo

Method RenderDebugInfo

trinity/Eve/EveTransform.cpp:175–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void EveTransform::RenderDebugInfo( ITr2DebugRenderer2& renderer )
176{
177 // is this one here enabled?
178 if( m_hideOnLowQuality && Tr2Renderer::IsLowQuality() )
179 {
180 return;
181 }
182
183 if( !m_isVisible )
184 {
185 return;
186 }
187
188 for( auto it = m_observers.begin(); it != m_observers.end(); ++it )
189 {
190 ( *it )->RenderDebugInfo( renderer );
191 }
192
193
194 if( renderer.HasOption( this, "Bounding Box" ) )
195 {
196 Vector3 minBounds( -0.5f, -0.5f, -0.5f );
197 Vector3 maxBounds( 0.5f, 0.5f, 0.5f );
198 uint32_t color = 0xff0000ff;
199 if( m_overrideBoundsMax.x != m_overrideBoundsMin.x || m_overrideBoundsMax.y != m_overrideBoundsMin.y || m_overrideBoundsMax.z != m_overrideBoundsMin.z )
200 {
201 minBounds = m_overrideBoundsMin;
202 maxBounds = m_overrideBoundsMax;
203 color = 0xffffffff;
204 }
205 else if( m_mesh && m_mesh->GetBoundingBox( minBounds, maxBounds ) )
206 {
207 color = 0xffffffff;
208 }
209 renderer.DrawBox( this, m_worldTransform, minBounds, maxBounds, Tr2DebugRenderer::Wireframe, color );
210 }
211 if( renderer.HasOption( this, "Bounding Sphere" ) )
212 {
213 Vector4 sphere;
214 if( GetBoundingSphere( sphere ) )
215 {
216 renderer.DrawSphere( this, Vector3( sphere.x, sphere.x, sphere.x ), sphere.w, 10, Tr2DebugRenderer::Wireframe, 0xff808000 );
217 }
218 }
219
220 if( renderer.HasOption( this, "Names" ) )
221 {
222 Vector3 minBounds( -0.5f, -0.5f, -0.5f );
223 Vector3 maxBounds( 0.5f, 0.5f, 0.5f );
224 if( m_mesh )
225 {
226 m_mesh->GetBoundingBox( minBounds, maxBounds );
227 }
228 renderer.DrawText( TRI_DBG_FONT_SMALL, maxBounds, 0xffffffff, m_name.c_str() );
229 }
230
231 if( m_mesh )
232 {

Callers

nothing calls this directly

Calls 9

GetBoundingSphereFunction · 0.85
HasOptionMethod · 0.80
Vector3Class · 0.50
beginMethod · 0.45
endMethod · 0.45
GetBoundingBoxMethod · 0.45
DrawBoxMethod · 0.45
DrawSphereMethod · 0.45
DrawTextMethod · 0.45

Tested by

no test coverage detected