-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRandom.h
More file actions
32 lines (22 loc) · 716 Bytes
/
Random.h
File metadata and controls
32 lines (22 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <random>
#include "Math.h"
class Random
{
public:
static void Init();
// Seed the generator with a specified int
// NOTE: you should generally not need to manually do this
static void seed(unsigned int seed);
// Get a float between 0.0f and 1.0f
static float GetFloat();
// Get float between the specified range
static float GetFloatRange(float min, float max);
// Get an int between the specified range
static int GetIntRange(int min, int max);
// Get a random vector given the min/max bounds
static Vector2 GetVector(const Vector2& min, const Vector2& max);
static Vector3 GetVector(const Vector3& min, const Vector3& max);
private:
static std::mt19937 sGenerator;
};