gwnavruntime/channel/bubbleblob.h Source File

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