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

Method GetBatches

trinity/Tr2MeshBase.cpp:428–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426
427
428void Tr2MeshBase::GetBatches( ITriRenderBatchAccumulator* batches,
429 const Tr2MeshAreaVector* areas,
430 const Tr2PerObjectData* data,
431 float screenSize ) const
432{
433 if( !GetDisplay() )
434 {
435 return;
436 }
437
438 auto geometry = GetGeometryResource();
439 if( !geometry || !geometry->IsGood() )
440 {
441 return;
442 }
443 TriGeometryResLodData* lod = geometry->GetMeshLod( m_meshIndex, screenSize );
444
445 if( !lod || !lod->m_allocationsValid )
446 {
447 return;
448 }
449
450 for( auto& area : *areas )
451 {
452 if( auto batch = CreateGeometryBatch( lod, area, data ) )
453 {
454 batch.SetPickingData( m_meshIndex, area->GetIndex() );
455 batches->Commit( batch );
456 }
457 }
458}
459
460// -------------------------------------------------------------
461// Description:

Callers

nothing calls this directly

Calls 6

CreateGeometryBatchFunction · 0.85
SetPickingDataMethod · 0.80
GetIndexMethod · 0.80
IsGoodMethod · 0.45
GetMeshLodMethod · 0.45
CommitMethod · 0.45

Tested by

no test coverage detected