tweaked the particle demo a little bit

This commit is contained in:
erwincoumans
2013-11-08 23:21:01 -08:00
parent 768ea211a6
commit a6bc61ad1a
8 changed files with 77 additions and 76 deletions

View File

@@ -17,6 +17,8 @@ subject to the following restrictions:
#ifndef B3_GEN_RANDOM_H
#define B3_GEN_RANDOM_H
#include "b3Scalar.h"
#ifdef MT19937
#include <limits.h>
@@ -38,5 +40,11 @@ B3_FORCE_INLINE unsigned int b3rand() { return rand(); }
#endif
inline b3Scalar b3RandRange(b3Scalar minRange, b3Scalar maxRange)
{
return (b3rand() / (b3Scalar(B3_RAND_MAX) + b3Scalar(1.0))) * (maxRange - minRange) + minRange;
}
#endif //B3_GEN_RANDOM_H