Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
Loading...
Searching...
No Matches
USquirrel13_RNG Class Reference

Random number generator. Seedable. Gives better random values than epic generator. More...

#include <SquirrelRNG.h>

Inheritance diagram for USquirrel13_RNG:

Public Member Functions

void InitBP (int seed, int position=0)
 Modify internal values to custom.
int GetNextInt (int min, int max)
 Move position by 1 and return random value as integer in range <min, max>.
int GetCurrentInt (int min, int max) const
 Return random value scaled to integer range <min, max> at current position.
double GetNextDouble ()
 Move position by 1 and return double in range <0, 1>.
double GetCurrentDouble () const
 Return last random double in range <0, 1>.
void SetPosition (int new_position)
 Set generator position.
void OffsetPosition (int offset=1)
 Offset current position, can be positive and negative.
void SetSeed (int new_seed)
 Set seed noise seed.
void SetNoiseVariant (int newVariant=0)
 Internal noise variants (it is not initialized), default=0, max=5 Invalid variants will use default noise.
void ResetSeedPos ()
 Reset to internal initial values.
virtual void Serialize (FArchive &Ar) override
 Serialization of RNG Object.

Static Public Member Functions

static uint32_t RNG_0 (int position, unsigned int seed)
 Noise variant.
static uint32_t RNG_1 (int position, unsigned int seed)
 Noise variant.
static uint32_t RNG_2 (int position, unsigned int seed)
 Noise variant.
static uint32_t RNG_3 (int position, unsigned int seed)
 Noise variant.
static uint32_t RNG_4 (int position, unsigned int seed)
 Noise variant.
static uint32_t RNG_5 (int position, unsigned int seed)
 Noise variant.

Protected Attributes

int m_variant {0}
 variable related to selected noise variant

Detailed Description

Random number generator. Seedable. Gives better random values than epic generator.

Member Function Documentation

◆ InitBP()

void USquirrel13_RNG::InitBP ( int seed,
int position = 0 )

Modify internal values to custom.

This function provides access to change private variables for C++ object which is not accessible in Blueprints.

◆ OffsetPosition()

void USquirrel13_RNG::OffsetPosition ( int offset = 1)

Offset current position, can be positive and negative.

Position + Offset


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