Changeset 13041 for OpenSceneGraph/trunk/src/osgParticle/FluidProgram.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgParticle/FluidProgram.cpp
r12597 r13041 31 31 float Area = osg::PI*radius*radius; 32 32 float Volume = Area*radius*four_over_three; 33 33 34 34 // compute force due to gravity + boyancy of displacing the fluid that the particle is emersed in. 35 35 osg::Vec3 accel_gravity = _acceleration * ((particle->getMass() - _density*Volume) * particle->getMassInv()); 36 36 37 37 // compute force due to friction 38 osg::Vec3 relative_wind = particle->getVelocity()-_wind; 38 osg::Vec3 relative_wind = particle->getVelocity()-_wind; 39 39 osg::Vec3 wind_force = - relative_wind * Area * (_viscosityCoefficient + _densityCoefficient*relative_wind.length()); 40 40 osg::Vec3 wind_accel = wind_force * particle->getMassInv(); … … 49 49 50 50 particle->addVelocity(accel_gravity*dt + wind_accel*compenstated_dt); 51 51 52 52 53 53 }
