| 406 | } |
| 407 | |
| 408 | void ForestCell::getItems( Vector<ForestItem> *outItems ) const |
| 409 | { |
| 410 | Vector<const ForestCell*> stack; |
| 411 | stack.push_back( this ); |
| 412 | |
| 413 | // Now loop till we run out of cells. |
| 414 | while ( !stack.empty() ) |
| 415 | { |
| 416 | // Pop off the next cell. |
| 417 | const ForestCell *cell = stack.last(); |
| 418 | stack.pop_back(); |
| 419 | |
| 420 | // Recurse thru non-leaf cells. |
| 421 | if ( !cell->isLeaf() ) |
| 422 | { |
| 423 | stack.merge( cell->mSubCells, 4 ); |
| 424 | continue; |
| 425 | } |
| 426 | |
| 427 | // Get the items. |
| 428 | outItems->merge( cell->getItems() ); |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | void ForestCell::buildPhysicsRep( Forest *forest ) |
| 433 | { |
no test coverage detected