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

Method RenderDebugInfo

trinity/Tr2InstancedMesh.cpp:545–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545void Tr2InstancedMesh::RenderDebugInfo( const Matrix& worldTransform, ITr2DebugRenderer2& renderer, const Matrix* boneTransforms, const int32_t* meshBindingIndices, size_t boneCount, const Tr2MorphTargetAnimationData* morphTargets, size_t morphTargetsCount )
546{
547 if( renderer.HasOption( this, "Instance Mesh Bounds" ) )
548 {
549 if( m_boundsMethod == STATIC )
550 {
551 renderer.DrawBox( this, worldTransform, m_minBounds, m_maxBounds, Tr2DebugRenderer::Wireframe, Tr2DebugColor( 0xffaa8800, 0x22aa8800 ) );
552 }
553 else
554 {
555 auto parentBounds = GetBounds();
556 if( parentBounds )
557 {
558 if( m_instanceGeometryResource )
559 {
560 auto sphere = GetInstanceBoundsClosestToPoint( TransformCoord( Tr2Renderer::GetViewPosition(), Inverse( worldTransform ) ) );
561 if( sphere && !parentBounds.IsPointInside( Tr2Renderer::GetViewPosition() ) )
562 {
563 auto aabb = CcpMath::AxisAlignedBox( sphere );
564 renderer.DrawBox( this, worldTransform, aabb.m_min, aabb.m_max, Tr2DebugRenderer::Wireframe, Tr2DebugColor( 0xff008888, 0x22008888 ) );
565 }
566 }
567 renderer.DrawBox( this, worldTransform, parentBounds.m_min, parentBounds.m_max, Tr2DebugRenderer::Wireframe, Tr2DebugColor( 0xff888888, 0x22888888 ) );
568 }
569 }
570 }
571}
572
573void Tr2InstancedMesh::SetDynamicBounds( float maxInstanceSize )
574{

Callers

nothing calls this directly

Calls 4

Tr2DebugColorClass · 0.85
GetViewPositionFunction · 0.85
HasOptionMethod · 0.80
DrawBoxMethod · 0.45

Tested by

no test coverage detected