gwnavruntime/pathfollower/shortcuttrajectoryblob.h Source File

shortcuttrajectoryblob.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 
14 
15 
16 
17 namespace Kaim
18 {
19 
20 class ShortcutTrajectoryBlob
21 {
22  KY_ROOT_BLOB_CLASS(Runtime, ShortcutTrajectoryBlob, 1)
23 
24 public:
25  ShortcutTrajectoryBlob() {}
26 
27  KyUInt32 m_visualDebugId;
28  Vec3f m_target;
29  KyUInt8 m_targetOnPathStatus;
30 };
31 
32 inline void SwapEndianness(Endianness::Target e, ShortcutTrajectoryBlob& self)
33 {
34  SwapEndianness(e, self.m_visualDebugId);
35  SwapEndianness(e, self.m_target);
36  SwapEndianness(e, self.m_targetOnPathStatus);
37 }
38 
39 class ShortcutTrajectoryBlobBuilder : public BaseBlobBuilder<ShortcutTrajectoryBlob>
40 {
41  KY_CLASS_WITHOUT_COPY(ShortcutTrajectoryBlobBuilder)
42 
43 public:
44  ShortcutTrajectoryBlobBuilder(KyUInt32 visualDebugId, const Vec3f& target, TargetOnPathStatus targetOnPathStatus)
45  : m_visualDebugId(visualDebugId)
46  , m_target(target)
47  , m_targetOnPathStatus(targetOnPathStatus)
48  {}
49 
50  virtual void DoBuild()
51  {
52  BLOB_SET(m_blob->m_visualDebugId, m_visualDebugId);
53  BLOB_SET(m_blob->m_target, m_target);
54  BLOB_SET(m_blob->m_targetOnPathStatus, (KyUInt8) m_targetOnPathStatus);
55  }
56 
57 private:
58  const KyUInt32 m_visualDebugId;
59  const Vec3f& m_target;
60  const TargetOnPathStatus m_targetOnPathStatus;
61 };
62 
63 } // namespace Kaim
64 
#define BLOB_SET(blob, value)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:130
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
TargetOnPathStatus
Enumerates the possible status values of Bot Position on path.
Definition: targetonpath.h:18
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
ShortcutTrajectoryBlob * m_blob
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
Definition: baseblobbuilder.h:113
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
std::uint8_t KyUInt8
uint8_t
Definition: types.h:27