OpenSceneGraph/include/osgParticle/LinearInterpolator

42 lines
1.0 KiB
Plaintext
Raw Normal View History

//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 <osgParticle/Interpolator>
#include <osg/CopyOp>
#include <osg/Object>
#include <osg/Vec3>
#include <osg/Vec4>
namespace osgParticle
{
/// A linear interpolator.
class LinearInterpolator: public Interpolator {
public:
LinearInterpolator()
: Interpolator() {}
LinearInterpolator(const LinearInterpolator &copy, const osg::CopyOp &copyop = 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