00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __DUSTY_RAND_GEN__H__
00033 #define __DUSTY_RAND_GEN__H__
00034
00035 #include <time.h>
00036 #include <stdlib.h>
00037 #include <irrlicht.h>
00038 #include "dustyengine.h"
00039
00040 namespace DustyEngine
00041 {
00043
00048 class DUSTYENGINE_API RandGen : public irr::IUnknown
00049 {
00050 public:
00052 RandGen(irr::IrrlichtDevice * device);
00053
00054 virtual ~RandGen();
00055
00057
00059 void Seed(irr::u32 s);
00060
00062
00064 void SeedTime();
00065
00067
00070 irr::s32 RandInt(irr::s32 max);
00071
00073
00077 irr::s32 RandInt(irr::s32 min, irr::s32 max);
00078
00080
00083 irr::f32 RandFloat(irr::f32 max);
00084
00086
00090 irr::f32 RandFloat(irr::f32 min, irr::f32 max);
00091
00093
00095 bool RandBool();
00096
00098
00105 irr::core::vector3di RandVector3di(irr::s32 minX = 0, irr::s32 maxX = 0, irr::s32 minY = 0, irr::s32 maxY = 0, irr::s32 minZ = 0, irr::s32 maxZ = 0);
00106
00108
00115 irr::core::vector3df RandVector3df(irr::f32 minX = 0.0f, irr::f32 maxX=0.0f, irr::f32 minY = 0.0f, irr::f32 maxY = 0.0f, irr::f32 minZ = 0.0f, irr::f32 maxZ = 0.0f);
00116
00118
00127 irr::video::SColor RandSColor(irr::s32 minR = 0, irr::s32 maxR = 255, irr::s32 minG = 0, irr::s32 maxG = 255, irr::s32 minB = 0, irr::s32 maxB = 255, irr::s32 minA = 0, irr::s32 maxA = 255);
00128
00130
00139 irr::video::SColorf RandSColorf(irr::f32 minR = 0.0f, irr::f32 maxR = 1.0f, irr::f32 minG = 0.0f, irr::f32 maxG = 1.0f, irr::f32 minB = 0.0f, irr::f32 maxB = 1.0f, irr::f32 minA = 0.0f, irr::f32 maxA = 1.0f);
00140
00141 private:
00142 irr::IrrlichtDevice * irrDevice;
00143 };
00144 }
00145
00146 #endif
00147