Panda3D
Public Member Functions | Static Public Member Functions | List of all members
Randomizer Class Reference

A handy class to return random numbers. More...

Public Member Functions

 __init__ (const Randomizer copy)
 
 __init__ (unsigned long int seed)
 If seed is nonzero, it is used to define the tables; if it is zero a random seed is generated. More...
 
unsigned long int getSeed ()
 Returns a unique seed value based on the seed value passed to this Randomizer object (and on its current state). More...
 
Randomizer operator= (const Randomizer copy)
 
int randomInt (int range)
 Returns a random integer in the range [0, range). More...
 
double randomReal (double range)
 Returns a random double in the range [0, range). More...
 
double randomRealUnit ()
 Returns a random double in the range [-0.5, 0.5). More...
 

Static Public Member Functions

static unsigned long int getNextSeed ()
 Returns a random seed value for the next global Randomizer object. More...
 

Detailed Description

A handy class to return random numbers.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const Randomizer  copy)

◆ __init__() [2/2]

__init__ ( unsigned long int  seed)

If seed is nonzero, it is used to define the tables; if it is zero a random seed is generated.

◆ getNextSeed()

static unsigned long int getNextSeed ( )
static

Returns a random seed value for the next global Randomizer object.

◆ getSeed()

unsigned long int getSeed ( )

Returns a unique seed value based on the seed value passed to this Randomizer object (and on its current state).

◆ operator=()

Randomizer operator= ( const Randomizer  copy)

◆ randomInt()

int randomInt ( int  range)

Returns a random integer in the range [0, range).

◆ randomReal()

double randomReal ( double  range)

Returns a random double in the range [0, range).

◆ randomRealUnit()

double randomRealUnit ( )

Returns a random double in the range [-0.5, 0.5).