25 static void seed(
unsigned int seedValue);
37 static int Int(
int min,
int max);
49 static float Float(
float min,
float max);
56 static glm::vec3
Color();
77 static void shuffle(std::vector<T> & items);
100 std::shuffle(items.begin(), items.end(),
_thread.
mt);
Generate seedable random numbers of various types and in multiple intervals. Handles per-thread rando...
Definition: Random.hpp:11
static unsigned int getSeed()
Definition: Random.cpp:17
static glm::vec3 Color()
Definition: Random.cpp:34
static std::mt19937 _shared
Shared randomness generator, used for seeding per-thread generators.
Definition: Random.hpp:93
static glm::vec3 sampleCosineHemisphere()
Definition: Random.cpp:65
static glm::vec3 sampleSphere()
Definition: Random.cpp:58
static unsigned int _seed
The current main seed.
Definition: Random.hpp:92
static thread_local LocalMT19937 _thread
Per-thread randomness generator, seeded using the shared generator.
Definition: Random.hpp:95
static glm::vec2 sampleDisk()
Definition: Random.cpp:41
static int Int(int min, int max)
Definition: Random.cpp:21
static void seed()
Definition: Random.cpp:3
static void shuffle(std::vector< T > &items)
Definition: Random.hpp:99
static float Float()
Definition: Random.cpp:25
static std::mutex _lock
The lock for the shared generator.
Definition: Random.hpp:94
A MT19937 generator seeded using the shared generator. Used to provide per-thread MT19937 generators ...
Definition: Random.hpp:83
unsigned int seed
The local seed.
Definition: Random.hpp:89
std::mt19937 mt
The randomness generator.
Definition: Random.hpp:88
LocalMT19937()
Definition: Random.cpp:72