src/systems/CollisionDetectionSystem.cpp
void CollisionDetectionSystem::swapPreviousAndCurrentContacts() {

    if (mPreviousContactPairs == &mContactPairs1) {

        mPreviousContactPairs = &mContactPairs2;
        mPreviousContactManifolds = &mContactManifolds2;
        mPreviousContactPoints = &mContactPoints2;

        mCurrentContactPairs = &mContactPairs1;
        mCurrentContactManifolds = &mContactManifolds1;
        mCurrentContactPoints = &mContactPoints1;
    }
    else {

        mPreviousContactPairs = &mContactPairs1;
        mPreviousContactManifolds = &mContactManifolds1;
        mPreviousContactPoints = &mContactPoints1;

        mCurrentContactPairs = &mContactPairs2;
        mCurrentContactManifolds = &mContactManifolds2;
        mCurrentContactPoints = &mContactPoints2;
    }
}
// Swap the previous and current contacts arrays
Swap the previous and current contacts arrays
Swap the previous and current contacts arrays
void CollisionDetectionSystem::swapPreviousAndCurrentContacts() {
    if (mPreviousContactPairs == &mContactPairs1) {
        mPreviousContactPairs = &mContactPairs2;
        mPreviousContactManifolds = &mContactManifolds2;
        mPreviousContactPoints = &mContactPoints2;
        mCurrentContactPairs = &mContactPairs1;
        mCurrentContactManifolds = &mContactManifolds1;
        mCurrentContactPoints = &mContactPoints1;
    }
    else {
        mPreviousContactPairs = &mContactPairs1;
        mPreviousContactManifolds = &mContactManifolds1;
        mPreviousContactPoints = &mContactPoints1;
        mCurrentContactPairs = &mContactPairs2;
        mCurrentContactManifolds = &mContactManifolds2;
        mCurrentContactPoints = &mContactPoints2;
    }
}
void CollisionDetectionSystem :: swapPreviousAndCurrentContacts ( ) { if ( mPreviousContactPairs == & mContactPairs1 ) { mPreviousContactPairs = & mContactPairs2 ; mPreviousContactManifolds = & mContactManifolds2 ; mPreviousContactPoints = & mContactPoints2 ; mCurrentContactPairs = & mContactPairs1 ; mCurrentContactManifolds = & mContactManifolds1 ; mCurrentContactPoints = & mContactPoints1 ; } else { mPreviousContactPairs = & mContactPairs1 ; mPreviousContactManifolds = & mContactManifolds1 ; mPreviousContactPoints = & mContactPoints1 ; mCurrentContactPairs = & mContactPairs2 ; mCurrentContactManifolds = & mContactManifolds2 ; mCurrentContactPoints = & mContactPoints2 ; } }
Swap the previous and current contacts arrays
Swap the previous and current contacts arrays