A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
System::Random Class Reference

Description

Definition at line 9 of file Random.hh.

Public Member Functions

 Random (u32 seed)
 
void next ()
 
u32 getU32 ()
 
u32 getU32 (u32 range)
 
f32 getF32 ()
 
f32 getF32 (f32 range)
 

Private Attributes

u64 m_x
 
u64 m_seed
 

Static Private Attributes

static constexpr u64 A = 0x690379B2B2E3D431
 
static constexpr u32 C = 0x508EBD
 
static constexpr f32 MUL = 1.0f / 4294967296.0f
 

Constructor & Destructor Documentation

◆ Random()

System::Random::Random ( u32 seed)
inline

Definition at line 11 of file Random.hh.

Member Function Documentation

◆ getF32() [1/2]

f32 System::Random::getF32 ( )
inlinenodiscard

Definition at line 29 of file Random.hh.

◆ getF32() [2/2]

f32 System::Random::getF32 ( f32 range)
inlinenodiscard

Definition at line 33 of file Random.hh.

◆ getU32() [1/2]

u32 System::Random::getU32 ( )
inlinenodiscard

Definition at line 19 of file Random.hh.

◆ getU32() [2/2]

u32 System::Random::getU32 ( u32 range)
inlinenodiscard

Definition at line 24 of file Random.hh.

◆ next()

void System::Random::next ( )
inline

Definition at line 15 of file Random.hh.

Member Data Documentation

◆ A

u64 System::Random::A = 0x690379B2B2E3D431
staticconstexprprivate

Definition at line 41 of file Random.hh.

◆ C

u32 System::Random::C = 0x508EBD
staticconstexprprivate

Definition at line 42 of file Random.hh.

◆ m_seed

u64 System::Random::m_seed
private

Definition at line 39 of file Random.hh.

◆ m_x

u64 System::Random::m_x
private

Definition at line 38 of file Random.hh.

◆ MUL

f32 System::Random::MUL = 1.0f / 4294967296.0f
staticconstexprprivate

Definition at line 43 of file Random.hh.