osgParticle::range< T_ > Struct Template Reference

A simple struct template useful to store ranges of values as min/max pairs. More...

List of all members.

Public Member Functions

 range ()
 Construct the object by calling default constructors for min and max.
 range (const T_ &mn, const T_ &mx)
 Construct and initialize min and max directly.
void set (const T_ &mn, const T_ &mx)
 Set min and max.
T_ get_random () const
 Get a random value between min and max.
T_ get_random_sqrtf () const
 Get a random square root value between min and max.

Public Attributes

T_ minimum
 Lower bound.
T_ maximum
 Higher bound.


Detailed Description

template<class T_>
struct osgParticle::range< T_ >

A simple struct template useful to store ranges of values as min/max pairs.

This struct template helps storing min/max ranges for values of any kind; class T_ is the type of values to be stored, and it must support operations T_ + T_, T_ - T_, and T_ * float, otherwise the get_random() method will not compile. This struct could be extended to customize the random number generator (now it uses only std::rand()).


Constructor & Destructor Documentation

template<class T_>
osgParticle::range< T_ >::range  )  [inline]
 

Construct the object by calling default constructors for min and max.

template<class T_>
osgParticle::range< T_ >::range const T_ &  mn,
const T_ &  mx
[inline]
 

Construct and initialize min and max directly.


Member Function Documentation

template<class T_>
T_ osgParticle::range< T_ >::get_random  )  const [inline]
 

Get a random value between min and max.

template<class T_>
T_ osgParticle::range< T_ >::get_random_sqrtf  )  const [inline]
 

Get a random square root value between min and max.

template<class T_>
void osgParticle::range< T_ >::set const T_ &  mn,
const T_ &  mx
[inline]
 

Set min and max.


Member Data Documentation

template<class T_>
T_ osgParticle::range< T_ >::maximum
 

Higher bound.

template<class T_>
T_ osgParticle::range< T_ >::minimum
 

Lower bound.


The documentation for this struct was generated from the following file:
Generated at Sat Mar 18 08:58:11 2006 for the OpenSceneGraph by doxygen 1.4.6.