예제 #1
0
ofxMSAPhysics* ofxMSAPhysics::addToCollision(ofxMSAParticle* p) {
	for(int i=0; i< numberOfParticles(); i++) {
		ofxMSAParticle *target = getParticle(i);
		if(target->hasCollision()) makeCollision(target, p);
	}
	return this;
}
예제 #2
0
void ContactListener::report()
{
	if (mReport.empty() || mRegistered.empty()) {
		mReport.clear();
		return;
	}

	for (auto it=mReport.begin(), end=mReport.end(); it!=end; ++it) {
		auto found = mRegistered.find(it->mSprite);
		if (found != mRegistered.end() && found->second) {
			Collision		c;
			c.mForce = it->mForce;
			makeCollision(*it, c);
			found->second(c);
		}
	}
	mReport.clear();
}