How do I generate random floats in C++?
I thought I could take the integer rand and divide it by something, would that be adequate enough?
Take a look at Boost.Random. You could do something like this:
float gen_random_float(float min, float max)
{
boost::mt19937 rng;
boost::uniform_real u(min, max);
boost::variate_generator > gen(rng, u);
return gen();
}
Play around, you might do better passing the same mt19937 object around instead of constructing a new one every time, but hopefully you get the idea.