OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
osgParticle::range< ValueType > Struct Template Reference

#include <range.h>

Collaboration diagram for osgParticle::range< ValueType >:
Collaboration graph
[legend]

Public Member Functions

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

Public Attributes

ValueType minimum
 Lower bound. More...
 
ValueType maximum
 Higher bound. More...
 

Detailed Description

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

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 ValueType is the type of values to be stored, and it must support operations ValueType + ValueType, ValueType - ValueType, and ValueType * float, otherwise the geValueTyperandom() method will not compile. This struct could be extended to customize the random number generator (now it uses only std::rand()).

Definition at line 38 of file range.h.

Constructor & Destructor Documentation

template<class ValueType>
osgParticle::range< ValueType >::range ( )
inline

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

Definition at line 48 of file range.h.

template<class ValueType>
osgParticle::range< ValueType >::range ( const ValueType &  mn,
const ValueType &  mx 
)
inline

Construct and initialize min and max directly.

Definition at line 51 of file range.h.

Member Function Documentation

template<class ValueType>
ValueType osgParticle::range< ValueType >::get_random ( ) const
inline

Get a random value between min and max.

Definition at line 57 of file range.h.

Here is the caller graph for this function:

template<class ValueType>
ValueType osgParticle::range< ValueType >::get_random_sqrtf ( ) const
inline

Get a random square root value between min and max.

Definition at line 63 of file range.h.

Here is the caller graph for this function:

template<class ValueType>
ValueType osgParticle::range< ValueType >::mid ( ) const
inline

Definition at line 68 of file range.h.

template<class ValueType>
void osgParticle::range< ValueType >::set ( const ValueType &  mn,
const ValueType &  mx 
)
inline

Set min and max.

Definition at line 54 of file range.h.

Here is the caller graph for this function:

Member Data Documentation

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

Higher bound.

Definition at line 45 of file range.h.

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

Lower bound.

Definition at line 42 of file range.h.


The documentation for this struct was generated from the following file: