gwnavruntime/channel/bubblearray.h Source File

bubblearray.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 
14 
15 namespace Kaim
16 {
17 
18 class DisplayListManager;
19 class BubbleArrayDisplayConfig;
20 
23 {
24 public:
25  BubbleArray();
26  ~BubbleArray();
27 
28  //-------------------- Array wrapping methods --------------------
29 
30  void Clear();
31  void Reserve(KyUInt32 bubbleCount);
32  void Resize(KyUInt32 bubbleCount);
33  void PushBack(const Bubble& bubble);
34  void Append(const BubbleArray& other);
35 
36  bool IsEmpty() const;
37  KyUInt32 GetCount() const;
38 
39  Bubble& At(KyUInt32 nodeIdx);
40  const Bubble& At(KyUInt32 nodeIdx) const;
41 
42  Bubble& operator[](KyUInt32 nodeIdx);
43  const Bubble& operator[](KyUInt32 nodeIdx) const;
44 
45 
46  //-------------------- Specific methods --------------------
47  void SendVisualDebug(DisplayListManager* displayListManager, const BubbleArrayDisplayConfig& displayConfig, const char* listBaseName = "",
48  const char* groupName = "BubbleArray", KyUInt32 visualDebugId = KyUInt32MAXVAL) const;
49 
50 private:
51  KyArray<Bubble> m_bubbleArray;
52 };
53 
54 KY_INLINE BubbleArray::BubbleArray() {}
55 KY_INLINE BubbleArray::~BubbleArray(){ Clear(); }
56 
57 KY_INLINE void BubbleArray::Clear() { m_bubbleArray.Clear(); }
58 KY_INLINE void BubbleArray::Reserve(KyUInt32 bubbleCount) { m_bubbleArray.Reserve(bubbleCount); }
59 KY_INLINE void BubbleArray::Resize(KyUInt32 bubbleCount) { m_bubbleArray.Resize(bubbleCount); }
60 KY_INLINE void BubbleArray::PushBack(const Bubble& bubble) { m_bubbleArray.PushBack(bubble); }
61 KY_INLINE void BubbleArray::Append(const BubbleArray& other) { m_bubbleArray.Append(other.m_bubbleArray); }
62 KY_INLINE bool BubbleArray::IsEmpty() const { return m_bubbleArray.IsEmpty(); }
63 KY_INLINE KyUInt32 BubbleArray::GetCount() const { return m_bubbleArray.GetCount(); }
64 KY_INLINE Bubble& BubbleArray::At(KyUInt32 nodeIdx) { return m_bubbleArray.At(nodeIdx); }
65 KY_INLINE const Bubble& BubbleArray::At(KyUInt32 nodeIdx) const { return m_bubbleArray.At(nodeIdx); }
66 KY_INLINE Bubble& BubbleArray::operator[](KyUInt32 nodeIdx) { return m_bubbleArray[nodeIdx]; }
67 KY_INLINE const Bubble& BubbleArray::operator[](KyUInt32 nodeIdx) const { return m_bubbleArray[nodeIdx]; }
68 
69 
70 class BubbleArrayPersistentDisplayListIds
71 {
72 public:
73  BubbleArrayPersistentDisplayListIds();
74  ~BubbleArrayPersistentDisplayListIds() {}
75 
76  void Initialize(DisplayListManager* displayListManager);
77  void Release();
78 
79 public:
80  DisplayListManager* m_displayListManager;
81  bool m_singleFrame;
82 
83  KyUInt32 m_displayListId_Bubbles;
84  KyUInt32 m_displayListId_BubbleIdx;
85 };
86 
87 class BubbleArrayDisplayConfig
88 {
89 public:
90  BubbleArrayDisplayConfig() { SetDefaults(); }
91 
92  void SetDefaults();
93 
94  Color m_bubbleColor_CCW;
95  Color m_bubbleColor_CW;
96  Color m_bubbleIdxColor;
97 
98  KyUInt32 m_diskSubdivision;
99  KyFloat32 m_verticalOffset;
100 
101  BubbleArrayPersistentDisplayListIds m_persistentDisplayListIds;
102 };
103 
104 } // namespace Kaim
105 
Game side: Manages all DisplayListData, send them to the NavigationLab.
Definition: displaylist.h:375
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
This class encapsulate an array of Bubbles.
Definition: bubblearray.h:22
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:162
This class represents a circle with potential rotation limitation.
Definition: bubble.h:31
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
#define KyUInt32MAXVAL
KyUInt32 max value
Definition: types.h:68
float KyFloat32
float
Definition: types.h:32