From a74acca858b5d2f8ee07d6e0cb521dbcdce1e5f0 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 21 Jun 2021 12:58:31 +0300 Subject: Expose `randfn` to global scope --- core/math/math_funcs.cpp | 4 ++++ core/math/math_funcs.h | 1 + 2 files changed, 5 insertions(+) (limited to 'core/math') diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index bbed257f60..2b6d92fe0e 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -53,6 +53,10 @@ uint32_t Math::rand() { return default_rand.rand(); } +double Math::randfn(double mean, double deviation) { + return default_rand.randfn(mean, deviation); +} + int Math::step_decimals(double p_step) { static const int maxn = 10; static const double sd[maxn] = { diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index e3b990d48f..8df45255c9 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -318,6 +318,7 @@ public: static uint32_t rand(); static _ALWAYS_INLINE_ double randd() { return (double)rand() / (double)Math::RANDOM_32BIT_MAX; } static _ALWAYS_INLINE_ float randf() { return (float)rand() / (float)Math::RANDOM_32BIT_MAX; } + static double randfn(double mean, double deviation); static double random(double from, double to); static float random(float from, float to); -- cgit v1.2.3