| 1584 | } |
| 1585 | |
| 1586 | void Sc::Scene::flush(bool sendPendingReports) |
| 1587 | { |
| 1588 | if (sendPendingReports) |
| 1589 | { |
| 1590 | fireQueuedContactCallbacks(true); |
| 1591 | mNPhaseCore->clearContactReportStream(); |
| 1592 | mNPhaseCore->clearContactReportActorPairs(true); |
| 1593 | |
| 1594 | fireTriggerCallbacks(); |
| 1595 | } |
| 1596 | else |
| 1597 | { |
| 1598 | mNPhaseCore->clearContactReportActorPairs(true); // To clear the actor pair set |
| 1599 | } |
| 1600 | postReportsCleanup(); |
| 1601 | mNPhaseCore->freeContactReportStreamMemory(); |
| 1602 | |
| 1603 | mTriggerBufferAPI.reset(); |
| 1604 | mTriggerBufferExtraData->reset(); |
| 1605 | |
| 1606 | clearBrokenConstraintBuffer(); |
| 1607 | mBrokenConstraints.reset(); |
| 1608 | |
| 1609 | clearSleepWakeBodies(); //!!! If we send out these reports on flush then this would not be necessary |
| 1610 | |
| 1611 | mClients.shrink(); |
| 1612 | |
| 1613 | mShapeIDTracker->reset(); |
| 1614 | mRigidIDTracker->reset(); |
| 1615 | |
| 1616 | processLostTouchPairs(); // Processes the lost touch bodies |
| 1617 | PX_ASSERT(mLostTouchPairs.size() == 0); |
| 1618 | mLostTouchPairs.reset(); |
| 1619 | // Does not seem worth deleting the bitmap for the lost touch pair list |
| 1620 | |
| 1621 | mActiveBodies.shrink(); |
| 1622 | |
| 1623 | for(PxU32 i=0; i < InteractionType::eTRACKED_IN_SCENE_COUNT; i++) |
| 1624 | { |
| 1625 | mInteractions[i].shrink(); |
| 1626 | } |
| 1627 | |
| 1628 | //!!! TODO: look into retrieving memory from the NPhaseCore & Broadphase class (all the pools in there etc.) |
| 1629 | |
| 1630 | mLLContext->getNpMemBlockPool().releaseUnusedBlocks(); |
| 1631 | } |
| 1632 | |
| 1633 | // User callbacks |
| 1634 |
no test coverage detected