From a8e0e48e56507c2781bb86a9cc7e23ceb13411be Mon Sep 17 00:00:00 2001 From: CorvusPrudens Date: Thu, 14 Sep 2023 13:34:19 -0600 Subject: [PATCH] Added setter for whitenoise seed --- Source/Noise/whitenoise.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Noise/whitenoise.h b/Source/Noise/whitenoise.h index d830c37d..1b4ec783 100644 --- a/Source/Noise/whitenoise.h +++ b/Source/Noise/whitenoise.h @@ -33,6 +33,9 @@ class WhiteNoise return (randseed_ * coeff_) * amp_; } + /** sets the seed (and corrects a seed of 0 to 1) */ + inline void SetSeed(int32_t s) { randseed_ = s == 0 ? 1 : s; } + private: static constexpr float coeff_ = 4.6566129e-010f; float amp_;