dustyrandgen.h

Go to the documentation of this file.
00001 /*
00002 Dusty Engine Library
00003 by Dave Andrews
00004 
00005 Dusty Engine is a task engine using the Irrlicht (irrlicht.sourceforge.net)
00006 3d Engine, by Nikolaus Gebhardt.
00007 
00008 This software is released on the zlib license.  Contents of that license follow.
00009 
00010   Copyright (C) 2005 Dave Andrews
00011 
00012   This software is provided 'as-is', without any express or implied
00013   warranty.  In no event will the authors be held liable for any damages
00014   arising from the use of this software.
00015 
00016   Permission is granted to anyone to use this software for any purpose,
00017   including commercial applications, and to alter it and redistribute it
00018   freely, subject to the following restrictions:
00019 
00020   1. The origin of this software must not be misrepresented; you must not
00021      claim that you wrote the original software. If you use this software
00022      in a product, an acknowledgment in the product documentation would be
00023      appreciated but is not required.
00024   2. Altered source versions must be plainly marked as such, and must not be
00025      misrepresented as being the original software.
00026   3. This notice may not be removed or altered from any source distribution.
00027 
00028   Dave Andrews (dave@daveandrews.org)
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 

Generated on Fri Jan 27 17:31:50 2006 for Dusty Engine by  doxygen 1.4.6-NO