7 #ifndef Navigation_BubbleStringPullerBetweenPivots_H
8 #define Navigation_BubbleStringPullerBetweenPivots_H
16 class StringPulledBubbleList;
20 class BubbleStringPullerBetweenPivots
25 class Pivot :
public ListNode<Pivot>
29 : m_globalArrayIdx(globalArrayIdx)
30 , m_localArrayIdx(localArrayIdx)
35 m_globalArrayIdx = globalArrayIdx;
36 m_localArrayIdx = localArrayIdx;
46 class BubbleArraySubSet
62 , m_subSetSide(BeforePivot)
67 , m_startGlobalIndex(startGlobalIndex)
68 , m_endGlobalIndex(endGlobalIndex)
69 , m_refBubbleGlobalIndex(endGlobalIndex)
70 , m_startLocalIndex(startLocalIndex)
71 , m_endLocalIndex(endLocalIndex)
72 , m_subSetSide(BeforePivot)
75 BubbleArraySubSet(Pivot* pivot, SubSetSide subSetSide,
const KyUInt32 startGlobalIndex,
const KyUInt32 endGlobalIndex,
KyUInt32 startLocalIndex,
KyUInt32 endLocalIndex)
77 , m_startGlobalIndex(startGlobalIndex)
78 , m_endGlobalIndex(endGlobalIndex)
79 , m_refBubbleGlobalIndex(endGlobalIndex)
80 , m_startLocalIndex(startLocalIndex)
81 , m_endLocalIndex(endLocalIndex)
82 , m_subSetSide(subSetSide)
91 SubSetSide m_subSetSide;
94 class IncreasingProjectionDistance2dLessSorter
97 IncreasingProjectionDistance2dLessSorter(
98 const BubbleArray* bubbleArray,
const Vec2f& referencePosition,
99 const Vec2f& referenceVector,
KyUInt32 referenceEndBubbleIdx)
100 : m_bubbleArray(bubbleArray)
101 , m_referencePosition(referencePosition)
102 , m_referenceVector(referenceVector)
103 , m_referenceEndBubbleIdx(referenceEndBubbleIdx)
109 if (firstIdx == m_referenceEndBubbleIdx)
111 if (secondIdx == m_referenceEndBubbleIdx)
114 const Bubble& firstBubble = m_bubbleArray->At(firstIdx);
115 const Bubble& secondBubble = m_bubbleArray->At(secondIdx);
117 const Vec2f vecToFirst = firstBubble.GetCenter().Get2d() - m_referencePosition;
118 const Vec2f vecToSecond = secondBubble.GetCenter().Get2d() - m_referencePosition;
120 return (
DotProduct(vecToFirst, m_referenceVector) <
DotProduct(vecToSecond, m_referenceVector));
124 const BubbleArray* m_bubbleArray;
125 Vec2f m_referencePosition;
126 Vec2f m_referenceVector;
132 KyResult SolveLocalStringPulledBubbleList(
const BubbleArray& bubbleArray, KyArrayPOD<KyUInt32>& cornerIndexArray,
133 KyUInt32 startGlobalIndex,
KyUInt32 endGlobalIndex, StringPulledBubbleList& stringPulledBubbleList);
140 KyResult TreatNextSubStrip(
const BubbleArray& bubbleArray, KyArrayPOD<KyUInt32>& funnelCornerIndices,
141 KyArray<BubbleArraySubSet>& subSets, KyArray<Pivot>& pivotArray, List<Pivot>& pivotList);
146 #endif // Navigation_BubbleStringPullerBetweenPivots_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
KyFloat32 DotProduct(const Vec2f &v1, const Vec2f &v2)
Returns the dot product of v1 and v2.
Definition: vec2f.h:187
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