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

Method RenderDebugInfo

trinity/Eve/VirtualCamera/EveVirtualCamera.cpp:407–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407void EveVirtualCamera::RenderDebugInfo( ITr2DebugRenderer2& renderer )
408{
409 if( renderer.HasOption( this, "Virtual Cameras" ) )
410 {
411 m_positionAnchorRadius = GetAnchorsBoundingSphereRadius( m_positionAnchors, m_positionAnchorCenter );
412 m_pointOfInterestAnchorRadius = GetAnchorsBoundingSphereRadius( m_pointOfInterestAnchors, m_pointOfInterestAnchorCenter );
413
414 auto coneSize = std::max( m_positionAnchorRadius * DEBUG_SCALAR, 1.0f );
415 auto poiSize = std::max( m_pointOfInterestAnchorRadius * DEBUG_SCALAR, 1.0f );
416
417 auto invView = Inverse( GetViewMatrix() );
418 auto coneTransform = TransformationMatrix( Vector3( 1, 1, 1 ), RotationQuaternion( RIGHT, XM_PI / 2 ), Vector3( 0, 0, coneSize / 2.0f + DEBUG_BORDER_SIZE ) ) * invView;
419 auto filmReel1Transform = TransformationMatrix( Vector3( 1, 1, 1 ), RotationQuaternion( FORWARD, XM_PI / 2 ), Vector3( 0, coneSize * 2.0f, coneSize * 2.0f ) ) * invView;
420 auto filmReel2Transform = TransformationMatrix( Vector3( 1, 1, 1 ), RotationQuaternion( FORWARD, XM_PI / 2 ), Vector3( 0, coneSize * 1.675f, coneSize * 3.55f ) ) * invView;
421
422 // Draw the camera
423 renderer.DrawCylinder( this, filmReel1Transform, coneSize, coneSize / 4, 12, Tr2DebugRenderer::Lit, DEBUG_COLOR );
424 renderer.DrawCylinder( this, filmReel2Transform, coneSize / 1.5f, coneSize / 4, 12, Tr2DebugRenderer::Lit, DEBUG_COLOR );
425 renderer.DrawCone( this, coneTransform, -coneSize, coneSize, 12, Tr2DebugRenderer::Lit, DEBUG_COLOR );
426 renderer.DrawBox( this, invView, Vector3( coneSize / 1.5f, coneSize, coneSize + DEBUG_BORDER_SIZE ), Vector3( -coneSize / 1.5f, -coneSize, coneSize * 4 ), Tr2DebugRenderer::Lit, DEBUG_COLOR );
427 renderer.DrawText( TRI_DBG_FONT_LARGE, m_position + GetForwardDirection() * coneSize * -2.0f, DEBUG_COLOR_SUCCESS, m_name.c_str() );
428
429 // Draw the point of interest
430 renderer.DrawText( TRI_DBG_FONT_LARGE, m_pointOfInterest, DEBUG_COLOR_SUCCESS, ( m_name + " POI" ).c_str() );
431 renderer.DrawSphere( this, m_pointOfInterest, poiSize, 16, Tr2DebugRenderer::Lit, DEBUG_COLOR );
432 }
433}

Callers

nothing calls this directly

Calls 8

HasOptionMethod · 0.80
Vector3Class · 0.50
DrawCylinderMethod · 0.45
DrawConeMethod · 0.45
DrawBoxMethod · 0.45
DrawTextMethod · 0.45
DrawSphereMethod · 0.45

Tested by

no test coverage detected