Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / ai_service / ai_inline.h
blob8a3f3f026283c71b35d2a686c61827cb7b6f5268
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef RYAI_AI_INLINE_H
20 #define RYAI_AI_INLINE_H
23 //-------------------------------------------------------------------
24 // Important boolean showing true when the singleton has been initialised
25 // and other pseudo-constants initialised at service init time
27 /*inline bool CAIS::initialised()
29 return _initialised;
32 //-------------------------------------------------------------------
33 // Interface to the random number generator
34 inline sint32 CAIS::randPlusMinus(uint16 mod) { return _random.randPlusMinus(mod); }
35 inline float CAIS::frand(double mod) { return _random.frand(mod); }
36 inline float CAIS::frandPlusMinus(double mod) { return _random.frandPlusMinus(mod); }
38 inline uint32 CAIS::rand32()
40 return ((uint32(_random.rand()))<<16)+uint32(_random.rand());
42 inline uint32 CAIS::rand32(uint32 mod)
44 if (mod==0)
45 return 0;
46 return rand32()%mod;
48 inline uint32 CAIS::rand16(uint32 mod)
50 if (mod==0)
51 return 0;
52 return _random.rand()%mod;
55 //-------------------------------------------------------------------
56 // Interface to the vision management matrices
58 // read accessors for getting hold of the vision matrices
59 inline const CAIEntityMatrixIteratorTblRandom *CAIS::matrixIterator2x2() { return &_matrixIterator2x2; }
60 inline const CAIEntityMatrixIteratorTblRandom *CAIS::matrixIterator3x3() { return &_matrixIterator3x3; }
63 #endif