Cyclone Cyclone: C:/data/physeng_code/include/cyclone/random.h Source File

C:/data/physeng_code/include/cyclone/random.h

Go to the documentation of this file.
00001 /*
00002  * Interface file for the random number generator.
00003  *
00004  * Part of the Cyclone physics system.
00005  *
00006  * Copyright (c) Icosagon 2003. All Rights Reserved.
00007  *
00008  * This software is distributed under licence. Use of this software
00009  * implies agreement with all terms and conditions of the accompanying
00010  * software licence.
00011  */
00012 
00018 #ifndef CYCLONE_RANDOM_H
00019 #define CYCLONE_RANDOM_H
00020 
00021 #include "core.h"
00022 
00023 namespace cyclone {
00024 
00025 
00032         class Random
00033         {
00034         public:
00035 
00040                 Random();
00041 
00045                 Random(unsigned seed);
00046 
00050                 void seed(unsigned seed);
00051 
00056                 unsigned randomBits();
00057 
00061                 real randomReal();
00062 
00066         real randomReal(real scale);
00067 
00071         real randomReal(real min, real max);
00072 
00076                 unsigned randomInt(unsigned max);
00077 
00082                 real randomBinomial(real scale);
00083 
00088                 Vector3 randomVector(real scale);
00089 
00096                 Vector3 randomVector(const Vector3 &scale);
00097 
00103         Vector3 randomVector(const Vector3 &min, const Vector3 &max);
00104 
00110                 Vector3 randomXZVector(real scale);
00111 
00115         Quaternion randomQuaternion();
00116 
00117         private:
00118                 // Internal mechanics
00119                 int p1, p2;
00120                 unsigned buffer[17];
00121         };
00122 
00123 } // namespace cyclone
00124 
00125 #endif // CYCLONE_BODY_H