OpenSceneGraph 3.6.5
osgParticle::range< ValueType > Struct Template Reference

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

#include <range>

Inheritance diagram for osgParticle::range< ValueType >:

Public Member Functions

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

Public Attributes

ValueType minimum
 Lower bound.
ValueType maximum
 Higher bound.

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()).

Constructor & Destructor Documentation

◆ range() [1/2]

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

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

◆ range() [2/2]

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

Construct and initialize min and max directly.

Member Function Documentation

◆ get_random()

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

Get a random value between min and max.

Referenced by osgParticle::CompositePlacer::place().

◆ get_random_sqrtf()

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

Get a random square root value between min and max.

◆ mid()

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

◆ set()

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

Set min and max.

Referenced by osgParticle::VariableRateCounter::setRateRange().

Member Data Documentation

◆ maximum

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

Higher bound.

Referenced by osgParticle::Interpolator::interpolate().

◆ minimum


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

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.