Faster random implementation
This commit is contained in:
parent
321c677da2
commit
742ef283e4
7 changed files with 49 additions and 10 deletions
|
|
@ -4,9 +4,16 @@
|
|||
#include <math.h>
|
||||
#include <memory>
|
||||
#include "timer.hpp"
|
||||
#include "random.h"
|
||||
|
||||
#define FAST_RANDOM 1
|
||||
#ifdef FAST_RANDOM
|
||||
pcg32_random_t pcg = { 0x853c49e6748fea9bULL, 0xda3e39cb94b95bdbULL };
|
||||
#define rand() pcg32_random_r(&pcg)
|
||||
#endif
|
||||
|
||||
/* Utility functions */
|
||||
float degrees_to_radians(float d)
|
||||
inline float degrees_to_radians(float d)
|
||||
{
|
||||
return d * M_PI / 180;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue