Integrated various fixes from users.

This commit is contained in:
Robert Osfield
2003-07-05 19:08:30 +00:00
parent 092c094752
commit 4c576770fb
4 changed files with 13 additions and 5 deletions

View File

@@ -41,5 +41,12 @@ void osgParticle::FluidFrictionOperator::operate(Particle *P, double dt)
Fr = current_program_->rotateLocalToWorld(Fr);
}
P->addVelocity(Fr * (P->getMassInv() * dt));
// correct unwanted velocity increments
osg::Vec3 dv = Fr * (P->getMassInv() * 0.01);
float dvl = dv.length();
if (dvl > vm) {
dv *= vm / dvl;
}
P->addVelocity(dv);
}