diff --git a/Source/Engine/Core/Random.h b/Source/Engine/Core/Random.h index 805c687ab..2fdfc1449 100644 --- a/Source/Engine/Core/Random.h +++ b/Source/Engine/Core/Random.h @@ -14,4 +14,15 @@ namespace Random { return (float)rand() / (float)RAND_MAX; } + + /// + /// Generates a pseudo-random number from specific range. + /// + /// The minimum value (inclusive). + /// The maximum value (inclusive). + /// The random number. + inline float RandRange(float min, float max) + { + return min + (max - min) * Rand(); + } }