summaryrefslogtreecommitdiff
path: root/vec.h
diff options
context:
space:
mode:
Diffstat (limited to 'vec.h')
-rw-r--r--vec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/vec.h b/vec.h
index b233220..d2dece0 100644
--- a/vec.h
+++ b/vec.h
@@ -234,6 +234,11 @@ public:
}
}
+ // Get a random real number in range [0, 1].
+ inline T range01_scalar() {
+ return uni(mt);
+ };
+
// Get a unit vector with random direction.
inline vec3<T> normalized() {
return range01().unit_vec();