![]() |
OpenSceneGraph
|
A simple struct template useful to store ranges of values as min/max pairs. More...

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... | |
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()).
|
inline |
Construct the object by calling default constructors for min and max.
|
inline |
Construct and initialize min and max directly.
|
inline |
Get a random value between min and max.
Referenced by osgParticle::CompositePlacer::place(), osgParticle::SectorPlacer::place(), osgParticle::BoxPlacer::place(), and osgParticle::RadialShooter::shoot().
|
inline |
Get a random square root value between min and max.
Referenced by osgParticle::SectorPlacer::place().
|
inline |
|
inline |
Set min and max.
Referenced by osgParticle::VariableRateCounter::setRateRange().
| ValueType osgParticle::range< ValueType >::maximum |
Higher bound.
Referenced by osgParticle::VariableRateCounter::getEstimatedMaxNumOfParticles(), osgParticle::Interpolator::interpolate(), osgParticle::RadialShooter::setInitialRotationalSpeedRange(), osgParticle::RadialShooter::setInitialSpeedRange(), osgParticle::SectorPlacer::setPhiRange(), osgParticle::RadialShooter::setPhiRange(), osgParticle::SectorPlacer::setRadiusRange(), osgParticle::RadialShooter::setThetaRange(), osgParticle::BoxPlacer::setXRange(), osgParticle::BoxPlacer::setYRange(), osgParticle::BoxPlacer::setZRange(), osgParticle::SectorPlacer::volume(), and osgParticle::BoxPlacer::volume().
| ValueType osgParticle::range< ValueType >::minimum |
Lower bound.
Referenced by osgParticle::range< float >::get_random(), osgParticle::range< float >::get_random_sqrtf(), osgParticle::Interpolator::interpolate(), osgParticle::RadialShooter::setInitialRotationalSpeedRange(), osgParticle::RadialShooter::setInitialSpeedRange(), osgParticle::SectorPlacer::setPhiRange(), osgParticle::RadialShooter::setPhiRange(), osgParticle::SectorPlacer::setRadiusRange(), osgParticle::RadialShooter::setThetaRange(), osgParticle::BoxPlacer::setXRange(), osgParticle::BoxPlacer::setYRange(), osgParticle::BoxPlacer::setZRange(), osgParticle::SectorPlacer::volume(), and osgParticle::BoxPlacer::volume().
1.8.13