gwnavruntime/channel/bubbleblob.h Source File

bubbleblob.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 #ifndef Navigation_BubbleBlob_H
8 #define Navigation_BubbleBlob_H
9 
10 
14 #include "bubble.h"
15 
16 
17 namespace Kaim
18 {
19 
20 class BubbleBlob
21 {
22  KY_ROOT_BLOB_CLASS(Runtime, BubbleBlob, 0)
23 
24 public:
25  BubbleBlob() {}
26 
27 public:
28  Vec3f m_center;
29  KyFloat32 m_radius;
30  KyUInt32 m_rotationDirection;
31  KyUInt32 m_type;
32 };
33 
34 inline void SwapEndianness(Endianness::Target e, BubbleBlob& self)
35 {
36  SwapEndianness(e, self.m_center);
37  SwapEndianness(e, self.m_radius);
38  SwapEndianness(e, self.m_rotationDirection);
39  SwapEndianness(e, self.m_type);
40 }
41 
42 
43 class BubbleBlobBuilder : public BaseBlobBuilder<BubbleBlob>
44 {
45  KY_CLASS_WITHOUT_COPY(BubbleBlobBuilder)
46 
47 public:
48  BubbleBlobBuilder(const Bubble* bubble)
49  : m_bubble(bubble)
50  {}
51 
52  virtual void DoBuild()
53  {
54  BLOB_SET(m_blob->m_center, m_bubble->GetCenter());
55  BLOB_SET(m_blob->m_radius, m_bubble->GetRadius());
56  BLOB_SET(m_blob->m_rotationDirection, KyUInt32(m_bubble->GetRotationDirection()));
57  BLOB_SET(m_blob->m_type, KyUInt32(m_bubble->GetType()));
58  }
59 
60 private:
61  const Bubble* m_bubble;
62 };
63 
64 } // namespace Kaim
65 
66 #endif // Navigation_Bubble_H
#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
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
BubbleBlob * 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
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43