#include "util.hpp" #include #include namespace util { float randf_m1_1() { return 2.0f*randf_0_1() - 1.0f; } float randf_0_1() { return static_cast(static_cast(rand()) / (double) RAND_MAX); } glm::vec2 randv2_m1_1() { return glm::vec2(randf_m1_1(), randf_m1_1()); } glm::vec2 randv2_0_1() { return glm::vec2(randf_0_1(), randf_0_1()); } float deg2rad(float deg) { return M_PI*deg/180.0; } float rad2deg(float rad) { return 180.0 * rad / M_PI; } }