gwnavruntime/pathfollower/circlearcsplinecomputerinputblob.h Source File

circlearcsplinecomputerinputblob.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 
13 
17 
18 
19 namespace Kaim
20 {
21 
22 // Internal:
23 // A blob containing all the necessary information to replay a CircleArcSplineComputer.
24 // This is typically used to replay error cases.
25 class CircleArcSplineComputerInputBlob
26 {
27  KY_ROOT_BLOB_CLASS(Runtime, CircleArcSplineComputerInputBlob, 0)
28 
29 public:
30  CircleArcSplineComputerInputBlob() {}
31 
32 public:
33  ChannelBlob m_channel;
34 
35  SplineComputationConfigBlob m_splineConfig;
36 
37  Vec3f m_startPosition;
38  Vec3f m_endPosition;
39 
40  Vec2f m_startConstraint;
41  Vec2f m_endConstraint;
42 
43  KyUInt32 m_startIndex;
44  KyUInt32 m_endIndex;
45 };
46 
47 inline void SwapEndianness(Endianness::Target e, CircleArcSplineComputerInputBlob& self)
48 {
49  SwapEndianness(e, self.m_channel);
50  SwapEndianness(e, self.m_splineConfig);
51  SwapEndianness(e, self.m_startPosition);
52  SwapEndianness(e, self.m_endPosition);
53  SwapEndianness(e, self.m_startConstraint);
54  SwapEndianness(e, self.m_endConstraint);
55  SwapEndianness(e, self.m_startIndex);
56  SwapEndianness(e, self.m_endIndex);
57 }
58 
59 
60 
61 class CircleArcSplineComputerInputBlobBuilder : public BaseBlobBuilder<CircleArcSplineComputerInputBlob>
62 {
63  KY_CLASS_WITHOUT_COPY(CircleArcSplineComputerInputBlobBuilder)
64 
65 public:
66  CircleArcSplineComputerInputBlobBuilder(const CircleArcSplineComputer* computer)
67  : m_computer(computer)
68  {}
69 
70  virtual void DoBuild()
71  {
72  BLOB_BUILD(m_blob->m_channel, ChannelBlobBuilder(m_computer->m_startSection.GetChannel()));
73  BLOB_BUILD(m_blob->m_splineConfig, SplineConfigBlobBuilder(m_computer->m_splineConfig));
74  BLOB_SET(m_blob->m_startPosition, m_computer->m_startPosition);
75  BLOB_SET(m_blob->m_endPosition, m_computer->m_endPosition);
76  BLOB_SET(m_blob->m_startConstraint, m_computer->m_startConstraint);
77  BLOB_SET(m_blob->m_endConstraint, m_computer->m_endConstraint);
78  BLOB_SET(m_blob->m_startIndex, m_computer->m_startSection.GetSectionIdx());
79  BLOB_SET(m_blob->m_endIndex, m_computer->m_endSection.GetSectionIdx());
80  }
81 
82 private:
83  const CircleArcSplineComputer* m_computer;
84 };
85 
86 
87 } // namespace Kaim
88 
#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 BLOB_BUILD(blob, builder)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:175
#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
CircleArcSplineComputerInputBlob * 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