示例#1
0
void Character::addRandomForce(float _f) {
    mForceTimer = _f;
    for(int i=0; i<mPhysics.numberOfParticles(); i++) {
        Physics::Particle3D *p = mPhysics.getParticle(i);
        if(p->isFree()) p->addVelocity(Vec3f(Rand::randFloat(-_f, _f), Rand::randFloat(-_f, _f), Rand::randFloat(-_f, _f)));
    }
}
示例#2
0
void addRandomForce(float f) {
	forceTimer = f;
	for(int i=0; i<physics.numberOfParticles(); i++) {
		Physics::Particle3D *p = physics.getParticle(i);
		if(p->isFree()) p->addVelocity(Vec3f(ofRandom(-f, f), ofRandom(-f, f), ofRandom(-f, f)));
	}
}