Cinder  0.9.1
Public Member Functions | Static Public Member Functions | List of all members
cinder::Rand Class Reference

#include <Rand.h>

Public Member Functions

 Rand ()
 
 Rand (uint32_t seed)
 
void seed (uint32_t seedValue)
 
bool nextBool ()
 
int32_t nextInt ()
 
uint32_t nextUint ()
 
int32_t nextInt (int32_t v)
 
uint32_t nextUint (uint32_t v)
 
int32_t nextInt (int32_t a, int32_t b)
 
float nextFloat ()
 
float nextFloat (float v)
 
float nextFloat (float a, float b)
 
float posNegFloat (float a, float b)
 
vec3 nextVec3 ()
 
vec2 nextVec2 ()
 
float nextGaussian ()
 

Static Public Member Functions

static void randomize ()
 
static void randSeed (uint32_t seedValue)
 
static bool randBool ()
 
static int32_t randInt ()
 
static uint32_t randUint ()
 
static int32_t randInt (int32_t v)
 
static uint32_t randUint (uint32_t v)
 
static int32_t randInt (int32_t a, int32_t b)
 
static float randFloat ()
 
static float randFloat (float v)
 
static float randFloat (float a, float b)
 
static float randPosNegFloat (float a, float b)
 
static vec3 randVec3 ()
 
static vec2 randVec2 ()
 
static float randGaussian ()
 

Constructor & Destructor Documentation

cinder::Rand::Rand ( )
cinder::Rand::Rand ( uint32_t  seed)

Member Function Documentation

void cinder::Rand::seed ( uint32_t  seedValue)

Re-seeds the random generator.

bool cinder::Rand::nextBool ( )

returns a random boolean value

int32_t cinder::Rand::nextInt ( )

returns a random integer in the range [-2147483648,2147483647]

uint32_t cinder::Rand::nextUint ( )

returns a random integer in the range [0,4294967296)

int32_t cinder::Rand::nextInt ( int32_t  v)

returns a random integer in the range [0,v)

uint32_t cinder::Rand::nextUint ( uint32_t  v)

returns a random integer in the range [0,v)

int32_t cinder::Rand::nextInt ( int32_t  a,
int32_t  b 
)

returns a random integer in the range [a,b)

float cinder::Rand::nextFloat ( )

returns a random float in the range [0.0f,1.0f)

float cinder::Rand::nextFloat ( float  v)

returns a random float in the range [0.0f,v)

float cinder::Rand::nextFloat ( float  a,
float  b 
)

returns a random float in the range [a,b)

float cinder::Rand::posNegFloat ( float  a,
float  b 
)

returns a random float in the range [a,b] or the range [-b,-a)

vec3 cinder::Rand::nextVec3 ( )

returns a random vec3 that represents a point on the unit sphere

vec2 cinder::Rand::nextVec2 ( )

returns a random vec2 that represents a point on the unit circle

float cinder::Rand::nextGaussian ( )

returns a random float via Gaussian distribution

void cinder::Rand::randomize ( )
static

Resets the static random generator to a random seed based on the clock.

void cinder::Rand::randSeed ( uint32_t  seedValue)
static

Resets the static random generator to the specific seed seedValue.

static bool cinder::Rand::randBool ( )
static

returns a random boolean value

static int32_t cinder::Rand::randInt ( )
static

returns a random integer in the range [-2147483648,2147483647]

static uint32_t cinder::Rand::randUint ( )
static

returns a random integer in the range [0,4294967296)

static int32_t cinder::Rand::randInt ( int32_t  v)
static

returns a random integer in the range [0,v)

static uint32_t cinder::Rand::randUint ( uint32_t  v)
static

returns a random integer in the range [0,v)

static int32_t cinder::Rand::randInt ( int32_t  a,
int32_t  b 
)
static

returns a random integer in the range [a,b)

static float cinder::Rand::randFloat ( )
static

returns a random float in the range [0.0f,1.0f)

static float cinder::Rand::randFloat ( float  v)
static

returns a random float in the range [0.0f,v)

static float cinder::Rand::randFloat ( float  a,
float  b 
)
static

returns a random float in the range [a,b)

static float cinder::Rand::randPosNegFloat ( float  a,
float  b 
)
static

returns a random float in the range [a,b) or the range [-b,-a)

static vec3 cinder::Rand::randVec3 ( )
static

returns a random vec3 that represents a point on the unit sphere

static vec2 cinder::Rand::randVec2 ( )
static

returns a random vec2 that represents a point on the unit circle

static float cinder::Rand::randGaussian ( )
static

returns a random float via Gaussian distribution; refactor later


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