hrplib
hrpCollision
Opcode
Ice
IceRandom.cpp
Go to the documentation of this file.
1
8
11
// Precompiled Header
12
#include "
Stdafx.h
"
13
14
using namespace
IceCore
;
15
16
void
IceCore:: SRand
(
udword
seed)
17
{
18
srand(seed);
19
}
20
21
udword
IceCore::Rand
()
22
{
23
return
rand();
24
}
25
26
27
static
BasicRandom
gRandomGenerator
(42);
28
29
udword
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
IceCore::GetRandomIndex
ICECORE_API udword GetRandomIndex(udword max_index)
Returns a random index so that 0<= index < max_index.
Definition:
IceRandom.cpp:29
IceCore::Rand
FUNCTION ICECORE_API udword Rand()
Definition:
IceRandom.cpp:21
IceCore
Definition:
OPC_IceHook.h:41
IceCore::SRand
FUNCTION ICECORE_API void SRand(udword seed)
Definition:
IceRandom.cpp:16
IceCore::BasicRandom
Definition:
OPC_IceHook.h:25
udword
unsigned int udword
sizeof(udword) must be 4
Definition:
IceTypes.h:65
Stdafx.h
gRandomGenerator
static BasicRandom gRandomGenerator(42)
IceCore::BasicRandom::Randomize
inline_ udword Randomize()
Definition:
OPC_IceHook.h:36
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:03