Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | List of all members
jop::Randomizer Class Reference

#include <Randomizer.hpp>

Public Member Functions

 Randomizer ()
 Default constructor. More...
 
 Randomizer (const std::default_random_engine::result_type seed)
 Constructor for initialization with a custom seed. More...
 
template<typename T >
range (const T start, const T end) const
 Returns a random value from given distribution. More...
 
template<typename T >
operator() (const T start, const T end) const
 Returns a random value from given distribution. More...
 
template<typename T >
glm::vec2 insideCircle (const T radius) const
 Get a random point within a circle. More...
 
template<typename T >
glm::vec3 insideSphere (const T radius) const
 Get a random point within a sphere. More...
 

Detailed Description

Class for picking random values from given distribution

Definition at line 37 of file Randomizer.hpp.

Constructor & Destructor Documentation

jop::Randomizer::Randomizer ( )

Default constructor.

Initializes the seed using std::random_device.

jop::Randomizer::Randomizer ( const std::default_random_engine::result_type  seed)

Constructor for initialization with a custom seed.

Parameters
seedThe seed to use

Member Function Documentation

template<typename T >
glm::vec2 jop::Randomizer::insideCircle ( const T  radius) const

Get a random point within a circle.

Parameters
radiusRadius of the circle
Returns
Random point inside a circle
template<typename T >
glm::vec3 jop::Randomizer::insideSphere ( const T  radius) const

Get a random point within a sphere.

Parameters
radiusRadius of the circle
Returns
Random point inside a sphere
template<typename T >
T jop::Randomizer::operator() ( const T  start,
const T  end 
) const

Returns a random value from given distribution.

Parameters
startStarting point of distribution
endEnding point of distribution
template<typename T >
T jop::Randomizer::range ( const T  start,
const T  end 
) const

Returns a random value from given distribution.

Parameters
startStarting point of distribution
endEnding point of distribution

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