OpenSceneGraph/include/osgParticle/VariableRateCounter

68 lines
1.9 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_VARIABLERATECOUNTER_
#define OSGPARTICLE_VARIABLERATECOUNTER_ 1
#include <osgParticle/Counter>
#include <osgParticle/range>
#include <osg/CopyOp>
#include <osg/Object>
namespace osgParticle
{
class VariableRateCounter: public Counter {
public:
inline VariableRateCounter();
inline VariableRateCounter(const VariableRateCounter &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *className() const { return "VariableRateCounter"; }
virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast<const VariableRateCounter *>(obj) != 0; }
inline const rangef &getRateRange() const;
inline void setRateRange(const rangef &r);
inline void setRateRange(float minrange, float maxrange);
protected:
virtual ~VariableRateCounter() {}
private:
rangef rate_range_;
};
// INLINE FUNCTIONS
inline VariableRateCounter::VariableRateCounter()
: Counter(), rate_range_(1, 1)
{
}
inline VariableRateCounter::VariableRateCounter(const VariableRateCounter &copy, const osg::CopyOp &copyop)
: Counter(copy, copyop), rate_range_(copy.rate_range_)
{
}
inline const rangef &VariableRateCounter::getRateRange() const
{
return rate_range_;
}
inline void VariableRateCounter::setRateRange(const rangef &r)
{
rate_range_ = r;
}
inline void VariableRateCounter::setRateRange(float minrange, float maxrange)
{
rate_range_.set(minrange, maxrange);
}
}
#endif