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

Method CollectAreaBlocks

trinity/Tr2MeshBase.cpp:507–521  ·  view source on GitHub ↗

------------------------------------------------------------- Description: Put the very basic info of a mesharea (block) into the provided vector. Arguments: areaBlockVector - vector to append the block to areaType - only append area blocks from this block -------------------------------------------------------------

Source from the content-addressed store, hash-verified

505// areaType - only append area blocks from this block
506// -------------------------------------------------------------
507void Tr2MeshBase::CollectAreaBlocks( std::vector<TriRenderBatchAreaBlock>& collector, TriBatchType areaType ) const
508{
509 const Tr2MeshAreaVector* areas = GetAreas( areaType );
510 for( auto a = areas->begin(); a != areas->end(); ++a )
511 {
512 if( areaType == TRIBATCHTYPE_OPAQUE && !( *a )->IsCastingShadows() )
513 {
514 // skip non-shadow casting areas when collecting areas for overlay rendering: such areas may cause problems
515 // (for example scaffolding + build effect)
516 continue;
517 }
518 TriRenderBatchAreaBlock ab( std::max( 0, ( *a )->GetIndex() ), std::max( 0, ( *a )->GetCount() ) );
519 collector.push_back( ab );
520 }
521}
522
523// -------------------------------------------------------------
524// Description:

Callers 1

RebuildCachedDataMethod · 0.80

Calls 5

IsCastingShadowsMethod · 0.80
GetIndexMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetCountMethod · 0.45

Tested by

no test coverage detected