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

Function GetPrimitiveCount

trinity/Resources/TriGeometryRes.cpp:158–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156
157
158uint32_t GetPrimitiveCount( const TriGeometryResLodData& lod, uint32_t index, uint32_t count )
159{
160 if( index >= lod.m_areas.size() )
161 {
162 return 0;
163 }
164
165 if( index + count > lod.m_areas.size() )
166 {
167 count = uint32_t( lod.m_areas.size() - index );
168 }
169
170 auto& meshArea = lod.m_areas[index];
171
172 uint32_t primCount = uint32_t( meshArea.m_primitiveCount );
173 for( uint32_t i = 1; i < count; ++i )
174 {
175 primCount += lod.m_areas[index + i].m_primitiveCount;
176 }
177 return primCount;
178}
179
180
181namespace

Callers 7

GetBatchesMethod · 0.85
CreateGeometryBatchFunction · 0.85
RenderAreasMethod · 0.85
GetPickingBatchesMethod · 0.85
GetBatchesMethod · 0.85
GetShadowBatchesMethod · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected