vengine  0.1.0
3D graphics engine made with Vulkan
Loading...
Searching...
No Matches
random.cpp
Go to the documentation of this file.
1#include "myLib/Random.hpp"
2
3int myLib::Random::randomInt(const int min, const int max)
4{
5 std::mt19937 gen(std::random_device{}());
6 std::uniform_int_distribution<> dis(min, max);
7 return dis(gen);
8}
9
10float myLib::Random::randomFloat(const float min, const float max)
11{
12 return min + static_cast<float>(randomInt(-1000, 1000)) / 1000.0f * (max - min);
13}
Class for random number generation.
static float randomFloat()
Definition Random.hpp:36
static int randomInt()
Definition Random.hpp:28