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

Method getDatablocks

Engine/source/forest/forestDataFile.cpp:743–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743U32 ForestData::getDatablocks( Vector<ForestItemData*> *outVector ) const
744{
745 Vector<const ForestCell*> stack;
746 U32 count = 0;
747
748 BucketTable::ConstIterator iter = mBuckets.begin();
749 for (; iter != mBuckets.end(); ++iter)
750 stack.push_back( iter->value );
751
752 // Now loop till we run out of cells.
753 while ( !stack.empty() )
754 {
755 // Pop off the next cell.
756 const ForestCell *cell = stack.last();
757 stack.pop_back();
758
759 // Recurse thru non-leaf cells.
760 if ( !cell->isLeaf() )
761 {
762 cell->getChildren( &stack );
763 continue;
764 }
765
766 // Go thru the items.
767 const Vector<ForestItem> &items = cell->getItems();
768 Vector<ForestItem>::const_iterator item = items.begin();
769 for ( ; item != items.end(); item++ )
770 {
771 ForestItemData *data = item->getData();
772
773 if (T3D::find( outVector->begin(), outVector->end(), data ) != outVector->end() )
774 continue;
775
776 count++;
777 outVector->push_back( data );
778 }
779 }
780
781 return count;
782}
783
784void ForestData::clearPhysicsRep( Forest *forest )
785{

Callers

nothing calls this directly

Calls 11

findFunction · 0.50
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
getItemsMethod · 0.45
getDataMethod · 0.45

Tested by

no test coverage detected