void unlockRandomParticles() { for(int i=0; i<physics.numberOfParticles(); i++) { Physics::Particle3D *p = physics.getParticle(i); p->makeFree(); } mouseNode.makeFixed(); }
void lockRandomParticles() { for(int i=0; i<physics.numberOfParticles(); i++) { Physics::Particle3D *p = physics.getParticle(i); if(ofRandom(0, 100) < FIX_PROBABILITY) p->makeFixed(); else p->makeFree(); } mouseNode.makeFixed(); }