#include <plib/sg.h>
#include <plib/ssg.h>
+#include <simgear/math/sg_random.h>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/polar3d.hxx>
sgSetVec3( relative_position, 0,0,0);
theField.reserve(200);
inViewClouds.reserve(200);
+ sg_srandom_time_10();
}
SGCloudField::~SGCloudField() {
static float Rnd(float n) {
- return n * (-0.5f + rand() / (float) RAND_MAX);
+ return n * (-0.5f + sg_random());
}
// for debug only
#include <plib/sg.h>
#include <plib/ssg.h>
+#include <simgear/math/sg_random.h>
#include <simgear/misc/sg_path.hxx>
#include STL_ALGORITHM
// return a random number between -n/2 and n/2
static float Rnd(float n) {
- return n * (-0.5f + rand() / (float) RAND_MAX);
+ return n * (-0.5f + sg_random());
}
// generate all sprite with defined boxes