#include <Rand.h>
Public Member Functions | |
Rand () | |
Rand (uint32_t seed) | |
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 | |
Static Public Member Functions | |
static void | randomize () |
Resets the static random generator to a random seed based on the clock. | |
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 |
cinder::Rand::Rand | ( | ) |
cinder::Rand::Rand | ( | uint32_t | seed | ) |
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]
Vec3f cinder::Rand::nextVec3f | ( | ) |
returns a random Vec3f that represents a point on the unit sphere
Vec2f cinder::Rand::nextVec2f | ( | ) |
returns a random Vec2f that represents a point on the unit circle
void cinder::Rand::randomize | ( | ) | [static] |
Resets the static random generator to a random seed based on the clock.
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