gwnavruntime/channel/stringpulledbubblelist.h Source File

stringpulledbubblelist.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_StringPulledBubbleList_H
8 #define Navigation_StringPulledBubbleList_H
9 
11 
12 
13 namespace Kaim
14 {
15 
16 class World;
17 class StringPuller;
18 
19 
20 class StringPullerPersistentDisplayListIds
21 {
22 public:
23  StringPullerPersistentDisplayListIds()
24  : m_world(KY_NULL)
25  , m_singleFrame(true)
26  , m_displayListId_Edges(KyUInt32MAXVAL)
27  , m_displayListId_Sectors(KyUInt32MAXVAL)
28  {}
29 
30  ~StringPullerPersistentDisplayListIds() {}
31 
32  void Initialize(World* world);
33  void Release();
34 
35 public:
36  World* m_world;
37  bool m_singleFrame;
38 
39  BubbleArrayPersistentDisplayListIds m_bubbleArrayPersistentDisplayListIds;
40  KyUInt32 m_displayListId_Edges;
41  KyUInt32 m_displayListId_Sectors;
42 };
43 
44 class StringPulledBubbleListDisplayConfig
45 {
46 public:
47  StringPulledBubbleListDisplayConfig() { SetDefaults(); }
48 
49  void SetDefaults();
50 
51  VisualShapeColor m_edgeColor;
52  VisualColor m_sectorStartColor;
53  VisualColor m_sectorEndColor;
54 
55  KyFloat32 m_arrowWidth; // if 0.0f, render just a line
56 
57  BubbleArrayDisplayConfig m_bubbleArrayDisplayConfig;
58  StringPullerPersistentDisplayListIds m_persistentDisplayListIds;
59 };
60 
61 
62 
63 class StringPulledEdge
64 {
65 public:
66  StringPulledEdge() {}
67 
68  Vec3f m_start;
69  Vec3f m_end;
70  Vec2f m_normalizedDir;
71 };
72 
73 class StringPulledBubbleList
74 {
75 public:
76  StringPulledBubbleList() {}
77 
78  void Clear();
79  void Reserve(KyUInt32 bubbleCount);
80  void Resize(KyUInt32 bubbleCount);
81  void PushBubble(const Bubble& bubble, KyUInt32 bubbleIndex) { m_bubbleArray.PushBack(bubble); m_bubbleIndexArray.PushBack(bubbleIndex); }
82  void Append(const StringPulledBubbleList& other);
83  KyResult Finalize();
84 
85  bool IsEmpty() const { return m_bubbleArray.IsEmpty(); }
86  KyUInt32 GetBubbleCount() const { return m_bubbleArray.GetCount(); }
87  const Bubble& GetBubble(KyUInt32 bubbleIdx) const { return m_bubbleArray[bubbleIdx]; }
88  KyUInt32 GetBubbleIndex(KyUInt32 bubbleIdx) const { return m_bubbleIndexArray[bubbleIdx]; }
89  KyUInt32 GetEdgeCount() const { return m_edges.GetCount(); }
90  const StringPulledEdge& GetEdge(KyUInt32 edgeIdx) const { return m_edges[edgeIdx]; }
91 
92  void SendVisualDebug(World* world, const StringPulledBubbleListDisplayConfig& displayConfig, const char* listBaseName = "", const char* groupName = "StringPuller", KyUInt32 visualDebugId = KyUInt32MAXVAL) const;
93 
94 private:
95  BubbleArray m_bubbleArray;
96  KyArray<KyUInt32> m_bubbleIndexArray;
97  KyArray<StringPulledEdge> m_edges;
98 };
99 
100 } // namespace Kaim
101 
102 #endif // Navigation_StringPulledBubbleList_H
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
#define KY_NULL
Null value.
Definition: types.h:247
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43