MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getItems

Method getItems

Engine/source/forest/forestDataFile.cpp:437–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437U32 ForestData::getItems( Vector<ForestItem> *outItems ) const
438{
439 AssertFatal( outItems, "ForestData::getItems() - The output vector was NULL!" );
440
441 PROFILE_SCOPE( ForestData_getItems );
442
443 Vector<const ForestCell*> stack;
444 U32 count = 0;
445
446 BucketTable::ConstIterator iter = mBuckets.begin();
447 for (; iter != mBuckets.end(); ++iter)
448 stack.push_back( iter->value );
449
450 // Now loop till we run out of cells.
451 while ( !stack.empty() )
452 {
453 // Pop off the next cell.
454 const ForestCell *cell = stack.last();
455 stack.pop_back();
456
457 // Recurse thru non-leaf cells.
458 if ( !cell->isLeaf() )
459 {
460 cell->getChildren( &stack );
461 continue;
462 }
463
464 // Get the items.
465 count += cell->getItems().size();
466 outItems->merge( cell->getItems() );
467 }
468
469 return count;
470}
471
472U32 ForestData::getItems( const Frustum &culler, Vector<ForestItem> *outItems ) const
473{

Callers 2

forestDataFile.cppFile · 0.45
getDatablocksMethod · 0.45

Calls 15

mSquaredFunction · 0.85
isBranchMethod · 0.80
isOverlappedMethod · 0.60
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45
lastMethod · 0.45
pop_backMethod · 0.45
isLeafMethod · 0.45
getChildrenMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected