Merge branch 'develop' into feature/MovementCharacter
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <ctime>
|
||||
#include "toolbox.h"
|
||||
|
||||
namespace toolbox
|
||||
@@ -43,5 +44,16 @@ namespace toolbox
|
||||
final.y = Lerp(from.y, to.y, amount);
|
||||
final.z = Lerp(from.z, to.z, amount);
|
||||
return final;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,4 +68,14 @@ namespace toolbox
|
||||
* @return position of where to go
|
||||
*/
|
||||
glm::vec3 Lerp(glm::vec3 from, glm::vec3 to, float amount);
|
||||
|
||||
/*
|
||||
* @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