コード例 #1
0
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;
		//}
	}
}
コード例 #2
0
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();
	}
}
コード例 #3
0
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() ) ); }
}