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

Method RenderDebugInfo

trinity/Eve/SpaceObject/EveSwarm.cpp:701–735  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: From EveShip2 --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

699// From EveShip2
700// --------------------------------------------------------------------------------
701void EveSwarm::RenderDebugInfo( ITr2DebugRenderer2& renderer )
702{
703 EveShip2::RenderDebugInfo( renderer );
704
705 for( unsigned i = 0; i < m_vehicles.size(); i++ )
706 {
707 Vector3 pos = m_vehicles[i].position;
708 if( renderer.HasOption( this, "Vehicles" ) )
709 {
710 renderer.DrawSphere( this, pos, m_debugSize, 4, Tr2DebugRenderer::Wireframe, 0xffff00ff );
711 renderer.DrawLine( this, pos, pos + m_vehicles[i].velocity, 0xffff00ff );
712 renderer.DrawLine( this, pos, pos + m_vehicles[i].acceleration, 0xff0000ff );
713 }
714
715 if( renderer.HasOption( this, "Forces" ) && m_debugInfo.size() > i )
716 {
717 renderer.DrawLine( this, pos, pos + m_debugInfo[i].alignment, 0xff7f7f00 );
718 renderer.DrawLine( this, pos, pos + m_debugInfo[i].anchor, 0xff007f7f );
719 renderer.DrawLine( this, pos, pos + m_debugInfo[i].cohesion, 0xff00007f );
720 renderer.DrawLine( this, pos, pos + m_debugInfo[i].separation, 0xff007f00 );
721 renderer.DrawLine( this, pos, pos + m_debugInfo[i].wander, 0xff7f0000 );
722 renderer.DrawLine( this, pos, pos + m_debugInfo[i].formation, 0xff7f7f7f );
723 }
724 }
725
726 if( renderer.HasOption( this, "Swarm Bounds" ) )
727 {
728 Vector4 bs;
729 Vector3 min, max;
730 GetBoundingSphere( bs );
731 GetLocalBoundingBox( min, max );
732 renderer.DrawSphere( this, bs, 6, Tr2DebugRenderer::Wireframe, 0xffff00ff );
733 renderer.DrawBox( this, min, max, Tr2DebugRenderer::Wireframe, 0xffff00ff );
734 }
735}
736
737// --------------------------------------------------------------------------------
738// Description:

Callers

nothing calls this directly

Calls 8

GetBoundingSphereFunction · 0.85
sizeMethod · 0.80
HasOptionMethod · 0.80
RenderDebugInfoFunction · 0.50
GetLocalBoundingBoxFunction · 0.50
DrawSphereMethod · 0.45
DrawLineMethod · 0.45
DrawBoxMethod · 0.45

Tested by

no test coverage detected