asc-community / MxEngine

C++ open source 3D game engine
BSD 3-Clause "New" or "Revised" License
1.12k stars 59 forks source link

Random::Range() goes out of specified range #57

Closed fall2019 closed 2 years ago

fall2019 commented 2 years ago

@Momo Hi. The particle system call this function at GetRandomVector3(ParticleSystem::Shape shape).
I replace int rng = Random::Range(0, 4); with std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution<> distr(0, 4); int rng = distr(gen); then works fine. So maybe the function range() should be fixed.

fall2019 commented 2 years ago

图片

MomoDeve commented 2 years ago

fixed: https://github.com/asc-community/MxEngine/pull/58