gwnavgamekit/gamekitsmartobjectcosttable.h Source File

gamekitsmartobjectcosttable.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 // primary contact: MAMU - secondary contact:
8 #ifndef Navigation_GameKitSmartObject_H
9 #define Navigation_GameKitSmartObject_H
10 
13 
14 namespace Kaim
15 {
16 
17 class Bot;
18 
21 {
22  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_GameKit)
23 
24 public:
25  GameKitSmartObjectInterval() : m_entranceIsAtBotProgressOnPath(false), m_exitAtTheEndOfPath(false) {}
26 
27  // Get next smartobject.
28  // If the bot's progress on path is already inside a smartobject, then we output this current smartobject.
29  static KyResult GetBotCurrentOrNextSmartObjectInterval(Bot* bot, GameKitSmartObjectInterval& out_interval, KyFloat32 distanceMax);
30 
31 public:
32  Vec3f m_entrance;
33  bool m_entranceIsAtBotProgressOnPath;
34  Vec3f m_exit;
35  bool m_exitAtTheEndOfPath; // means that the destination is within this interval (example: in the middle of the door)
36  GameKitNavTag m_navTag;
37 };
38 
39 
40 class GameKitSmartObjectCostTable : public RefCountBase<GameKitSmartObjectCostTable, MemStat_GameKit>
41 {
42 public:
43  GameKitSmartObjectCostTable();
44  ~GameKitSmartObjectCostTable();
45 
48  void SetSmartObjectCostMultiplier(KyUInt32 smartObjectID, KyFloat32 costMultiplier);
49  void UnsetSmartObject(KyUInt32 smartObjectID);
50 
52  void AllowSmartObject(KyUInt32 smartObjectID);
53 
55  void ForbidSmartObject(KyUInt32 smartObjectID);
56 
58  bool IsSmartObjectRegistered(KyUInt32 smartObjectID);
59 
61  void Clear();
62 
63 public: // internal
64  bool CanTraverseSmartObject(KyUInt32 smartObjectID, KyFloat32* costMultiplier) const;
65 
66 private:
67  Hash<KyUInt32, KyFloat32> m_smartObjectsHash;
68 };
69 
70 }
71 
72 #endif
This class is the world element that represent an active character in Gameware Navigation.
Definition: bot.h:150
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Define an interpretation of NavTag specific to GameKit.
Definition: gamekitnavtag.h:24
Definition: gamekitcrowddispersion.h:20
Defines an interval in the path of a bot where there is a smartobject.
Definition: gamekitsmartobjectcosttable.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23