gwnavruntime/path/livepathblob.h Source File

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