//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield //Distributed under the terms of the GNU Library General Public License (LGPL) //as published by the Free Software Foundation. //osgParticle - Copyright (C) 2002 Marco Jez #ifndef OSGPARTICLE_LINEARINTERPOLATOR_ #define OSGPARTICLE_LINEARINTERPOLATOR_ #include #include #include #include #include namespace osgParticle { /// A linear interpolator. class LinearInterpolator: public Interpolator { public: LinearInterpolator() : Interpolator() {} LinearInterpolator(const LinearInterpolator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY) : Interpolator(copy, copyop) {} META_Object(osgParticle, LinearInterpolator); virtual float interpolate(float t, float y1, float y2) const { return y1 + (y2 - y1) * t; } protected: virtual ~LinearInterpolator() {} }; } #endif