gwnavruntime/pathfollower/shortcuttrajectoryblob.h Source File

shortcuttrajectoryblob.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: MAMU - secondary contact: NOBODY
9 
10 #ifndef Navigation_ShortcutTrajectory_Blob_H
11 #define Navigation_ShortcutTrajectory_Blob_H
12 
17 
18 
19 
20 namespace Kaim
21 {
22 
23 class ShortcutTrajectoryBlob
24 {
25  KY_ROOT_BLOB_CLASS(Runtime, ShortcutTrajectoryBlob, 1)
26 
27 public:
28  ShortcutTrajectoryBlob() {}
29 
30  KyUInt32 m_visualDebugId;
31  Vec3f m_target;
32  KyUInt8 m_targetOnPathStatus;
33 };
34 
35 inline void SwapEndianness(Endianness::Target e, ShortcutTrajectoryBlob& self)
36 {
37  SwapEndianness(e, self.m_visualDebugId);
38  SwapEndianness(e, self.m_target);
39  SwapEndianness(e, self.m_targetOnPathStatus);
40 }
41 
42 class ShortcutTrajectoryBlobBuilder : public BaseBlobBuilder<ShortcutTrajectoryBlob>
43 {
44  KY_CLASS_WITHOUT_COPY(ShortcutTrajectoryBlobBuilder)
45 
46 public:
47  ShortcutTrajectoryBlobBuilder(KyUInt32 visualDebugId, const Vec3f& target, TargetOnPathStatus targetOnPathStatus)
48  : m_visualDebugId(visualDebugId)
49  , m_target(target)
50  , m_targetOnPathStatus(targetOnPathStatus)
51  {}
52 
53  virtual void DoBuild()
54  {
55  BLOB_SET(m_blob->m_visualDebugId, m_visualDebugId);
56  BLOB_SET(m_blob->m_target, m_target);
57  BLOB_SET(m_blob->m_targetOnPathStatus, (KyUInt8) m_targetOnPathStatus);
58  }
59 
60 private:
61  const KyUInt32 m_visualDebugId;
62  const Vec3f& m_target;
63  const TargetOnPathStatus m_targetOnPathStatus;
64 };
65 
66 } // namespace Kaim
67 
68 #endif
#define BLOB_SET(blob, value)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:136
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
TargetOnPathStatus
Enumerates the possible status values of Bot Position on path.
Definition: targetonpath.h:20
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
unsigned char KyUInt8
Type used internally to represent an unsigned 8-bit integer.
Definition: types.h:41
ShortcutTrajectoryBlob * m_blob
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
Definition: baseblobbuilder.h:117
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36