[FEATURE] simple house generator

This commit is contained in:
Menno
2021-06-04 15:49:56 +02:00
parent cfd2d00d08
commit 8c50792657
6 changed files with 78 additions and 13 deletions

View File

@@ -1,3 +1,4 @@
#include <ctime>
#include "toolbox.h"
namespace toolbox
@@ -31,4 +32,15 @@ namespace toolbox
matrix = glm::translate(matrix, negative_cam_pos);
return matrix;
}
int Random(const int min, const int max)
{
static bool first = true;
if (first)
{
srand(time(0));
first = false;
}
return min + rand() % ((max + 1) - min);
}
}

View File

@@ -46,4 +46,14 @@ namespace toolbox
* @return: The view matrix
*/
glm::mat4 CreateViewMatrix(entities::Camera& camera);
/*
* @brief: This function will return a value between min and max
*
* @param min: The min value
* @param max: The max value
*
* @return: The random number
*/
int Random(const int min, const int max);
}