diff options
author | Keuin <[email protected]> | 2022-04-16 15:22:13 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-04-16 15:22:17 +0800 |
commit | 52a8d9345762e7b2755ca78ae237058c8ebaa20c (patch) | |
tree | 764e4ed7e5e79039806ef1ce08c08bdab0418ee4 | |
parent | b26a0168788a28c384d394b9e3bb4ebaebc815c2 (diff) |
Add vec3::range01_scalar.
-rw-r--r-- | vec.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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(); |