gwnavgamekit/gamekitsmartobjectcosttable.h Source File

gamekitsmartobjectcosttable.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
11 
12 namespace Kaim
13 {
14 
15 class Bot;
16 
19 {
20  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_GameKit)
21 
22 public:
23  GameKitSmartObjectInterval() : m_entranceIsAtBotProgressOnPath(false), m_exitAtTheEndOfPath(false) {}
24 
25  // Get next smartobject.
26  // If the bot's progress on path is already inside a smartobject, then we output this current smartobject.
27  static KyResult GetBotCurrentOrNextSmartObjectInterval(Bot* bot, GameKitSmartObjectInterval& out_interval, KyFloat32 distanceMax);
28 
29 public:
30  Vec3f m_entrance;
31  bool m_entranceIsAtBotProgressOnPath;
32  Vec3f m_exit;
33  bool m_exitAtTheEndOfPath; // means that the destination is within this interval (example: in the middle of the door)
34  GameKitNavTag m_navTag;
35 };
36 
37 
38 class GameKitSmartObjectCostTable : public RefCountBase<GameKitSmartObjectCostTable, MemStat_GameKit>
39 {
40 public:
41  GameKitSmartObjectCostTable();
42  ~GameKitSmartObjectCostTable();
43 
46  void SetSmartObjectCostMultiplier(KyUInt32 smartObjectID, KyFloat32 costMultiplier);
47  void UnsetSmartObject(KyUInt32 smartObjectID);
48 
50  void AllowSmartObject(KyUInt32 smartObjectID);
51 
53  void ForbidSmartObject(KyUInt32 smartObjectID);
54 
56  bool IsSmartObjectRegistered(KyUInt32 smartObjectID);
57 
59  void Clear();
60 
61 public: // internal
62  bool CanTraverseSmartObject(KyUInt32 smartObjectID, KyFloat32* costMultiplier) const;
63 
64 private:
65  Hash<KyUInt32, KyFloat32> m_smartObjectsHash;
66 };
67 
68 }
69 
This class is the world element that represent an active character in Autodesk Navigation.
Definition: bot.h:128
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Define an interpretation of NavTag specific to GameKit.
Definition: gamekitnavtag.h:21
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Defines an interval in the path of a bot where there is a smartobject.
Definition: gamekitsmartobjectcosttable.h:18
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16