chugins
chugins copied to clipboard
chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG)
chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG) by undefining RAND_MAX.
Seems like an opportunity to modernize and decouple. Both chugins want a rand2f function. Here's a simple+modern+portable one.
#include <random>
float rand2f (float min, float max)
{
static std::mt19937 s_mt;
static std::uniform_real_distribution<float> s_dist(0.f, 1.f);
float x = s_dist(s_mt);
return min + x * (max - min);
}
looking into this (@celestebetancur @nshaheed @gewang) we believe this is indeed due to rand2f using both ::random() and CK_RANDOM_MAX; the latter is determined by platform and may be inconsistent with ::random(); we plan to fix this post chuck-1.5, where we have a number of chugin evolutions on the roadmap.