Panda3D
Public Member Functions | Static Public Member Functions

Randomizer Class Reference

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

List of all members.

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

A handy class to return random numbers.


Constructor & Destructor Documentation

Randomizer ( Randomizer const  copy)
Randomizer ( unsigned long int  seed)

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

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


Member Function Documentation

static unsigned long int getNextSeed ( ) [static]

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

unsigned long int getSeed ( )

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

Randomizer operator= ( Randomizer const  copy)
int randomInt ( int  range)

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

double randomReal ( double  range)

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

double randomRealUnit ( )

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

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties