00001 00008 00009 #ifndef __KX_RANDOMNUMBERGENERATOR 00010 #define __KX_RANDOMNUMBERGENERATOR 00011 00012 00013 class SCA_RandomNumberGenerator { 00014 00016 long m_seed; 00017 00018 /* A bit silly.. The N parameter is a define in the .cpp file */ 00020 /* unsigned long mt[N]; */ 00021 unsigned long mt[624]; 00022 00024 int mti; /* initialised in the cpp file */ 00025 00027 void SetStartVector(void); 00028 public: 00029 SCA_RandomNumberGenerator(long seed); 00030 ~SCA_RandomNumberGenerator(); 00031 unsigned long Draw(); 00032 float DrawFloat(); 00033 long GetSeed(); 00034 void SetSeed(long newseed); 00035 }; 00036 00037 #endif /* __KX_RANDOMNUMBERGENERATOR */