[osg-users] division by zero in osgParticle/FluidProgram.cpp

Csaba Halász csaba.halasz at gmail.com
Wed Mar 4 19:16:22 PST 2009


Hi!

If wind_accel has zero length, then line 43

 double critical_dt2 = relative_wind.length2()/wind_accel.length2();

will attempt a divide by zero. A simple fix would be to check for zero
but that would still leave the possibility of an overflow if the
divisor is small. So a more clever check would be nice. Any
suggestions?

-- 
Csaba



More information about the osg-users mailing list