Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::RandomSource Class Reference

#include <RandomSource.hpp>

Public Member Functions

 RandomSource ()
 RandomSource (u32 root)
void reseed (u32 root)
u32 root () const
std::mt19937 stream (std::string_view name) const

Detailed Description

Definition at line 29 of file RandomSource.hpp.

Constructor & Destructor Documentation

◆ RandomSource() [1/2]

esengine::RandomSource::RandomSource ( )
inline

Definition at line 31 of file RandomSource.hpp.

◆ RandomSource() [2/2]

esengine::RandomSource::RandomSource ( u32 root)
inlineexplicit

Definition at line 34 of file RandomSource.hpp.

References root().

Member Function Documentation

◆ reseed()

void esengine::RandomSource::reseed ( u32 root)
inline

Make every stream taken from here on reproduce from root.

Definition at line 37 of file RandomSource.hpp.

References root().

◆ root()

u32 esengine::RandomSource::root ( ) const
inline

Definition at line 39 of file RandomSource.hpp.

Referenced by RandomSource(), and reseed().

◆ stream()

std::mt19937 esengine::RandomSource::stream ( std::string_view name) const
inline

An independent generator for name, the same one every time for a root.

Definition at line 42 of file RandomSource.hpp.

References esengine::hash::fnv1a32().

Referenced by esengine::particle::ParticleSystem::reseedFrom().


The documentation for this class was generated from the following file: