| 504 | } |
| 505 | |
| 506 | int NvFlexExtGetActiveList(NvFlexExtContainer* c, int* indices) |
| 507 | { |
| 508 | int count = 0; |
| 509 | |
| 510 | Bitmap inactive(c->mMaxParticles); |
| 511 | |
| 512 | // create bitmap |
| 513 | for (size_t i=0; i < c->mFreeList.size(); ++i) |
| 514 | { |
| 515 | // if this fires then somehow a duplicate has ended up in the free list (double delete) |
| 516 | assert(!inactive.IsSet(c->mFreeList[i])); |
| 517 | |
| 518 | inactive.Set(c->mFreeList[i]); |
| 519 | } |
| 520 | |
| 521 | // iterate bitmap to find active elements |
| 522 | for (int i=0; i < c->mMaxParticles; ++i) |
| 523 | if (inactive.IsSet(i) == false) |
| 524 | indices[count++] = i; |
| 525 | |
| 526 | return count; |
| 527 | } |
| 528 | |
| 529 | NvFlexExtParticleData NvFlexExtMapParticleData(NvFlexExtContainer* c) |
| 530 | { |
no test coverage detected