gwnavgamekit/gamekitnavtag.h Source File

gamekitnavtag.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 
8 
9 // primary contact: MAMU - secondary contact:
10 #ifndef Navigation_GameKitNavTag_H
11 #define Navigation_GameKitNavTag_H
12 
16 
17 namespace Kaim
18 {
19 
20 
23 class GameKitNavTag : public RefCountBase<GameKitNavTag, MemStat_GameKit>
24 {
25 public:
27  {
28  m_navTag.m_blindDataArray.Resize(4);
29  m_navTag.m_blindDataArray[0] = KyUInt32MAXVAL;
30  m_navTag.m_blindDataArray[1] = KyUInt32MAXVAL;
31  m_navTag.m_blindDataArray[2] = KyUInt32MAXVAL;
32  m_navTag.m_blindDataArray[3] = KyUInt32MAXVAL;
33  m_navTag.SetColor(0, 0, 139);
34  }
35 
36  KY_INLINE bool IsExclusive() const { return m_navTag.IsExclusive(); }
37  KY_INLINE bool HasSmartObject() const { return GetSmartObjectID() != KyUInt32MAXVAL; }
38  KY_INLINE bool HasLayer() const { return GetLayerID() != KyUInt32MAXVAL; }
39 
40  KY_INLINE KyUInt32 GetLayerID() const { return m_navTag.m_blindDataArray[0]; }
41  KY_INLINE KyUInt32 GetSmartObjectID() const { return m_navTag.m_blindDataArray[1]; }
42  KY_INLINE KyUInt32 GetGameObjectUniqueID() const { return m_navTag.m_blindDataArray[2]; }
43  KY_INLINE KyUInt32 GetUserDataID() const { return m_navTag.m_blindDataArray[3]; }
44  KY_INLINE Kaim::VisualColor GetColor() const { return Kaim::VisualColor(m_navTag.m_colorR, m_navTag.m_colorG, m_navTag.m_colorB); }
45 
46  KY_INLINE void SetAsExclusive() { m_navTag.SetAsExclusive(); }
47  KY_INLINE void SetLayerID(KyUInt32 layerID) { m_navTag.m_blindDataArray[0] = layerID; }
48  KY_INLINE void SetSmartObjectID(KyUInt32 smartObjectID) { m_navTag.m_blindDataArray[1] = smartObjectID; }
49  KY_INLINE void SetGameObjectUniqueID(KyUInt32 gameObjectUniqueID) { m_navTag.m_blindDataArray[2] = gameObjectUniqueID; }
50  KY_INLINE void SetUserDataID(KyUInt32 userDataID) { m_navTag.m_blindDataArray[3] = userDataID; }
51  KY_INLINE void SetColor(const Kaim::VisualColor& color) { m_navTag.SetColor(color); }
52  KY_INLINE void SetColor(KyUInt8 r, KyUInt8 g, KyUInt8 b) { m_navTag.SetColor(r,g,b); }
53 
54  KY_INLINE const Kaim::DynamicNavTag& GetDynamicNavTag() const { return m_navTag; }
55 
56 
57  // ------ Initialization from non-GameKitNavTag -----
58  // NavTag not being exactly the size of a GameKitNavTag will be reinterpreted as follow:
59  // - If longer, trailing words will be ignored
60  // - If shorter, missing words will be considered being KyUInt32MAXVAL
61  // Returned KyResult is here to help users detect such issues, not that in all cases the GameKitNavTag will be modified.
62 
63  KyResult InitFrom(const Kaim::DynamicNavTag& dynamicNavTag);
64  KyResult InitFrom(const Kaim::NavTag& navTag);
65 
66 private:
67  Kaim::DynamicNavTag m_navTag;
68 };
69 
70 
71 }
72 
73 #endif
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Represents a single RGBA color.
Definition: visualcolor.h:19
Define an interpretation of NavTag specific to GameKit.
Definition: gamekitnavtag.h:24
unsigned char KyUInt8
Type used internally to represent an unsigned 8-bit integer.
Definition: types.h:41
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226