aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ode-0.9/OPCODE/Ice/IceRandom.cpp
diff options
context:
space:
mode:
authordan miller2007-10-19 05:24:38 +0000
committerdan miller2007-10-19 05:24:38 +0000
commitf205de7847da7ae1c10212d82e7042d0100b4ce0 (patch)
tree9acc9608a6880502aaeda43af52c33e278e95b9c /libraries/ode-0.9/OPCODE/Ice/IceRandom.cpp
parenttrying to fix my screwup part deux (diff)
downloadopensim-SC-f205de7847da7ae1c10212d82e7042d0100b4ce0.zip
opensim-SC-f205de7847da7ae1c10212d82e7042d0100b4ce0.tar.gz
opensim-SC-f205de7847da7ae1c10212d82e7042d0100b4ce0.tar.bz2
opensim-SC-f205de7847da7ae1c10212d82e7042d0100b4ce0.tar.xz
from the start... checking in ode-0.9
Diffstat (limited to 'libraries/ode-0.9/OPCODE/Ice/IceRandom.cpp')
-rw-r--r--libraries/ode-0.9/OPCODE/Ice/IceRandom.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/libraries/ode-0.9/OPCODE/Ice/IceRandom.cpp b/libraries/ode-0.9/OPCODE/Ice/IceRandom.cpp
new file mode 100644
index 0000000..cc63a04
--- /dev/null
+++ b/libraries/ode-0.9/OPCODE/Ice/IceRandom.cpp
@@ -0,0 +1,35 @@
1///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2/**
3 * Contains code for random generators.
4 * \file IceRandom.cpp
5 * \author Pierre Terdiman
6 * \date August, 9, 2001
7 */
8///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
9
10///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
11// Precompiled Header
12#include "Stdafx.h"
13
14using namespace IceCore;
15
16void IceCore:: SRand(udword seed)
17{
18 srand(seed);
19}
20
21udword IceCore::Rand()
22{
23 return rand();
24}
25
26
27static BasicRandom gRandomGenerator(42);
28
29udword IceCore::GetRandomIndex(udword max_index)
30{
31 // We don't use rand() since it's limited to RAND_MAX
32 udword Index = gRandomGenerator.Randomize();
33 return Index % max_index;
34}
35