gwnavruntime/path/livepathblob.h Source File

livepathblob.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 // primary contact: LAPA - secondary contact: NOBODY
9 #ifndef Navigation_LivePathBlob_H
10 #define Navigation_LivePathBlob_H
11 
17 
18 
19 namespace Kaim
20 {
21 
22 class LivePath;
23 
24 
26 // LivePathDetailsBlob
27 class LivePathDetailsBlob
28 {
29 public:
30  LivePathDetailsBlob() : m_newPathSource(PathSource_NoPath) {}
31 
32  KyUInt32 m_newPathSource;
33  PositionOnPathBlob m_lowerBound;
34  PositionOnPathBlob m_upperBound;
35  BlobArray<PositionOnPathBlob> m_pathEventPositionOnPaths;
36  BlobArray<KyUInt8> m_pathEventCheckPointStatus;
37  BlobArray<Vec2f> m_pathEventDirections;
38 };
39 
40 inline void SwapEndianness(Endianness::Target e, LivePathDetailsBlob& self)
41 {
42  SwapEndianness(e, self.m_newPathSource);
43  SwapEndianness(e, self.m_lowerBound);
44  SwapEndianness(e, self.m_upperBound);
45  SwapEndianness(e, self.m_pathEventPositionOnPaths);
46  SwapEndianness(e, self.m_pathEventCheckPointStatus);
47  SwapEndianness(e, self.m_pathEventDirections);
48 }
49 
50 class LivePathDetailsBlobBuilder: public BaseBlobBuilder<LivePathDetailsBlob>
51 {
52  KY_CLASS_WITHOUT_COPY(LivePathDetailsBlobBuilder)
53 
54 public:
55  LivePathDetailsBlobBuilder(const LivePath* livePath): m_livePath(livePath) {}
56  ~LivePathDetailsBlobBuilder() {}
57 
58 private:
59  virtual void DoBuild();
60 
61  const LivePath* m_livePath;
62 };
63 
64 
66 // LivePathBlob
67 class LivePathBlob
68 {
69  KY_ROOT_BLOB_CLASS(Runtime, LivePathBlob, 1)
70 
71 public:
72  LivePathBlob() : m_pathType(PathSource_NoPath), m_pathValidityStatus(PathIsValid) {}
73 
74  KyUInt32 m_visualDebugId;
75  KyFloat32 m_botHeight;
76  Vec3f m_botPosition;
77  PathFinderQueryBlob m_pathFinderInfo;
78  BlobRef<LivePathDetailsBlob> m_details;
79  KyUInt32 m_pathType;
80  KyUInt32 m_pathValidityStatus;
81 };
82 
83 inline void SwapEndianness(Endianness::Target e, LivePathBlob& self)
84 {
85  SwapEndianness(e, self.m_visualDebugId);
86  SwapEndianness(e, self.m_botHeight);
87  SwapEndianness(e, self.m_botPosition);
88  SwapEndianness(e, self.m_pathFinderInfo);
89  SwapEndianness(e, self.m_details);
90  SwapEndianness(e, self.m_pathType);
91  SwapEndianness(e, self.m_pathValidityStatus);
92 }
93 
94 class LivePathBlobBuilder: public BaseBlobBuilder<LivePathBlob>
95 {
96  KY_CLASS_WITHOUT_COPY(LivePathBlobBuilder)
97 
98 public:
99  LivePathBlobBuilder(const LivePath* livePath, const Vec3f& botPos, KyFloat32 height)
100  : m_livePath(livePath)
101  , m_botPos(botPos)
102  , m_botHeight(height)
103  , m_visualDebugId(0)
104  {}
105 
106  ~LivePathBlobBuilder() {}
107 
108 private:
109  virtual void DoBuild();
110 
111 public:
112  const LivePath* m_livePath;
113  const Vec3f m_botPos;
114  KyFloat32 m_botHeight;
115  KyUInt32 m_visualDebugId;
116 };
117 
118 } // namespace Kaim
119 
120 #endif // Navigation_LivePathBlob_H
The Path has not been set yet or has been Cleared.
Definition: livepath.h:46
The Path has been completely checked and is valid.
Definition: pathvalidityinterval.h:51
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
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