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
3
int
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
10
float
myLib::Random::randomFloat
(
const
float
min,
const
float
max)
11
{
12
return
min +
static_cast<
float
>
(randomInt(-1000, 1000)) / 1000.0f * (max - min);
13
}
Random.hpp
Class for random number generation.
myLib::Random::randomFloat
static float randomFloat()
Definition
Random.hpp:36
myLib::Random::randomInt
static int randomInt()
Definition
Random.hpp:28
lib
local
static
myLib
src
random.cpp
Generated by
1.11.0