[FEATURE] simple house generator
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user