#include <Rand.h>
Public Member Functions | |
Rand () | |
Rand (uint32_t seed) | |
void | seed (uint32_t seedValue) |
Re-seeds the random generator. | |
bool | nextBool () |
returns a random boolean value | |
int32_t | nextInt () |
returns a random integer in the range [0,2147483647] | |
int32_t | nextInt (int32_t v) |
returns a random integer in the range [0,v) | |
int32_t | nextInt (int32_t a, int32_t b) |
returns a random integer in the range [a,b) | |
float | nextFloat () |
returns a random float in the range [0.0f,1.0f] | |
float | nextFloat (float v) |
returns a random float in the range [0.0f,v] | |
float | nextFloat (float a, float b) |
returns a random float in the range [a,b] | |
float | posNegFloat (float a, float b) |
returns a random float in the range [a,b] or the range [-b,-a] | |
Vec3f | nextVec3f () |
returns a random Vec3f that represents a point on the unit sphere | |
Vec2f | nextVec2f () |
returns a random Vec2f that represents a point on the unit circle | |
float | nextGaussian () |
returns a random float via Gaussian distribution | |
Static Public Member Functions | |
static void | randomize () |
Resets the static random generator to a random seed based on the clock. | |
static void | randSeed (uint32_t seedValue) |
Resets the static random generator to the specific seed seedValue. | |
static bool | randBool () |
returns a random boolean value | |
static int32_t | randInt () |
returns a random integer in the range [0,2147483647] | |
static int32_t | randInt (int32_t v) |
returns a random integer in the range [0,v) | |
static int32_t | randInt (int32_t a, int32_t b) |
returns a random integer in the range [a,b) | |
static float | randFloat () |
returns a random float in the range [0.0f,1.0f] | |
static float | randFloat (float v) |
returns a random float in the range [0.0f,v] | |
static float | randFloat (float a, float b) |
returns a random float in the range [a,b] | |
static float | randPosNegFloat (float a, float b) |
returns a random float in the range [a,b] or the range [-b,-a] | |
static Vec3f | randVec3f () |
returns a random Vec3f that represents a point on the unit sphere | |
static Vec2f | randVec2f () |
returns a random Vec2f that represents a point on the unit circle | |
static float | randGaussian () |
returns a random float via Gaussian distribution; refactor later |
cinder::Rand::Rand | ( | uint32_t | seed | ) |
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 [0,2147483647]
int32_t cinder::Rand::nextInt | ( | int32_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]
returns a random Vec3f that represents a point on the unit sphere
returns a random Vec2f 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 [0,2147483647]
static int32_t cinder::Rand::randInt | ( | int32_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 Vec3f cinder::Rand::randVec3f | ( | ) | [static] |
returns a random Vec3f that represents a point on the unit sphere
static Vec2f cinder::Rand::randVec2f | ( | ) | [static] |
returns a random Vec2f that represents a point on the unit circle
static float cinder::Rand::randGaussian | ( | ) | [static] |
returns a random float via Gaussian distribution; refactor later