Hello
I need to generate random number between 0 and 1. like 0.121, 0.576 etc. Which method is doing that ??
Ogre::Math::UnitRandom();
Ogre::Math::RandomValueProvider::getRandom();
or some other ?
best
levan
random number [0, 1]
- tod
- Troll
- Posts: 1394
- Joined: Wed Aug 02, 2006 9:41 am
- Location: Bucharest
- x 94
- Contact:
Re: random number [0, 1]
You sure do have a lot of questions. You do know there is a manual, a wiki, and the Ogre sources? Just in case I'm not around.
Click the above link for the answer, and a chance to win valuable insight!!!
Click the above link for the answer, and a chance to win valuable insight!!!
- Herb
- Orc
- Posts: 412
- Joined: Thu Jun 04, 2009 3:21 am
- Location: Kalamazoo,MI
- x 38
Re: random number [0, 1]
From the ogre3d Manual:
Generate a random number within the range provided.
Parameters
fLow The lower bound of the range.
fHigh The upper bound of the range.
Returns
A random number in the range from [fLow,fHigh].
Code: Select all
static Real Ogre::Math::RangeRandom(Real fLow, Real fHigh )
Parameters
fLow The lower bound of the range.
fHigh The upper bound of the range.
Returns
A random number in the range from [fLow,fHigh].