15#ifndef OSGPARTICLE_RANGE
16#define OSGPARTICLE_RANGE 1
38 template<
class ValueType>
struct range
65 return minimum + (
maximum -
minimum) * sqrtf(
static_cast<float>(rand()) /
static_cast<float>(RAND_MAX) );
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
Definition AccelOperator:27
range< osg::Vec2 > rangev2
Range of osg::Vec2s.
Definition range:79
range< osg::Vec4 > rangev4
Range of osg::Vec4s.
Definition range:85
range< osg::Vec3 > rangev3
Range of osg::Vec3s.
Definition range:82
range< float > rangef
Range of floats.
Definition range:76
A simple struct template useful to store ranges of values as min/max pairs.
Definition range:39
void set(const ValueType &mn, const ValueType &mx)
Set min and max.
Definition range:54
range()
Construct the object by calling default constructors for min and max.
Definition range:48
float maximum
Definition range:45
ValueType get_random_sqrtf() const
Get a random square root value between min and max.
Definition range:63
ValueType get_random() const
Get a random value between min and max.
Definition range:57
ValueType mid() const
Definition range:68
float minimum
Definition range:42
range(const ValueType &mn, const ValueType &mx)
Construct and initialize min and max directly.
Definition range:51