diff --git a/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp b/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp index d06e5fbae..4044fabad 100644 --- a/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp +++ b/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp @@ -1,6 +1,8 @@ #include +#include + #include #include #include @@ -25,6 +27,7 @@ bool FluidFrictionOperator_readLocalData(osg::Object &obj, osgDB::Input &fr) bool itAdvanced = false; float f; + osg::Vec3 w; if (fr[0].matchWord("fluidDensity")) { if (fr[1].getFloat(f)) { @@ -50,6 +53,14 @@ bool FluidFrictionOperator_readLocalData(osg::Object &obj, osgDB::Input &fr) } } + if (fr[0].matchWord("wind")) { + if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) && fr[3].getFloat(w.z())) { + aop.setWind(w); + fr += 4; + itAdvanced = true; + } + } + return itAdvanced; } @@ -58,6 +69,9 @@ bool FluidFrictionOperator_writeLocalData(const osg::Object &obj, osgDB::Output const osgParticle::FluidFrictionOperator &aop = static_cast(obj); fw.indent() << "fluidDensity " << aop.getFluidDensity() << std::endl; fw.indent() << "fluidViscosity " << aop.getFluidViscosity() << std::endl; - fw.indent() << "overrideRadius " << aop.getOverrideRadius(); + fw.indent() << "overrideRadius " << aop.getOverrideRadius() << std::endl; + + osg::Vec3 w = aop.getWind(); + fw.indent() << "wind " << w << std::endl; return true; }