void TrexContactListener::EndContact(b2Contact *contact){ auto fixA = contact->GetFixtureA(); auto fixB = contact->GetFixtureB(); fixA = getFix(fixA); fixB = getFix(fixB); if (fixA || fixB){ GAME_STATE->contactCount--; cout<<"Pushing"<<GAME_STATE->contactCount<<endl; //if (GAME_STATE->contactCount <= 0){ // GAME_STATE->pushingFixture = NULL; //} } }
void TrexContactListener::BeginContact(b2Contact *contact){ auto fixA = contact->GetFixtureA(); auto fixB = contact->GetFixtureB(); fixA = getFix(fixA); fixB = getFix(fixB); if (fixA || fixB){ GAME_STATE->contactCount++; cout<<"Pushing"<<GAME_STATE->contactCount<<endl; GAME_STATE->pushingFixture = fixA ? fixA : fixB; GAME_STATE->pushingNormal = contact->GetManifold()->localNormal; GAME_STATE->pushingNormal.Normalize(); } }
void test_getFix() { int count = 200; while (count--) { assertTrue("Fix should be inside {16, 64, 256, 1024, 4 * 1024, 16 * 1024}", isInsideArray (fixArray, size, getFix() ) ); } }