Skip to content
Snippets Groups Projects
Commit 8d87d7e3 authored by Yoel's avatar Yoel
Browse files

Added a critical difference to -1,1 and 0,1 dis

parent d5ab6b56
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
namespace util {
Vec3 rand_vec3() {
return Vec3(dis(gen), dis(gen), dis(gen));
return Vec3(dis0to1(gen), dis0to1(gen), dis0to1(gen));
}
bool in_circle(const Vec3& v) {
......
......@@ -8,7 +8,8 @@ namespace util {
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_real_distribution<> dis(-1.0, 1.0);
static std::uniform_real_distribution<> dis0to1(0.0, 1.0);
static std::uniform_real_distribution<> disMinus1To1(-1.0, 1.0);
Vec3 rand_vec3();
bool in_circle(const Vec3& v);
Vec3 rand_vec3_in_circle(float r);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment