17 class DisplayListManager;
19 class BubbleToCornerFunnel;
23 class BubbleFunnelBorder
27 : m_isInitialized(false)
30 BubbleFunnelBorder(
KyUInt32 bubbleIdx,
const Vec3f& segmentStart,
const Vec3f& segmentEnd)
32 Set(bubbleIdx, segmentStart, segmentEnd);
37 m_isInitialized =
false;
40 void Set(
KyUInt32 bubbleIdx,
const Vec3f& segmentStart,
const Vec3f& segmentEnd)
42 m_segmentStart = segmentStart;
43 m_segmentEnd = segmentEnd;
45 const Vec2f segmentVec2d = segmentEnd.Get2d() - segmentStart.Get2d();
46 m_segmentLength2d = segmentVec2d.GetNormalized(m_segmentDir2d);
48 m_bubbleIdx = bubbleIdx;
49 m_isInitialized =
true;
52 const Vec3f& GetSegmentStart()
const {
return m_segmentStart; }
53 const Vec3f& GetSegmentEnd()
const {
return m_segmentEnd; }
54 const Vec2f& GetSegmentDir2d()
const {
return m_segmentDir2d; }
55 KyFloat32 GetSegmentLength2d()
const {
return m_segmentLength2d; }
56 KyUInt32 GetBubbleIdx()
const {
return m_bubbleIdx; }
57 bool IsInitialized()
const {
return m_isInitialized; }
60 friend class BubbleToCornerFunnel;
76 : m_bubbleArray(bubbleArray)
77 , m_previousResult(FunnelUnchanged)
78 , m_funnelBordersDisplayList(
nullptr)
79 , m_displayListManager(displayListManager)
80 , m_advancedVisualDebuggingEnabled(advancedVisualDebuggingEnabled)
81 , m_loopGroupName(loopGroupName)
89 KyUInt32 GetApexIdx()
const {
return m_apexIdx; }
90 const Bubble& GetApexBubble()
const {
return m_apexBubble; }
91 const BubbleFunnelBorder& GetLeftBorder()
const {
return m_leftBorder; }
92 const BubbleFunnelBorder& GetRightBorder()
const {
return m_rightBorder; }
93 FunnelResult GetPreviousResult()
const {
return m_previousResult; }
97 bool IsOutsideOnLeft(
const Vec2f& axis2d)
const;
98 bool IsOutsideOnRight(
const Vec2f& axis2d)
const;
100 bool IsOutsideOnLeft_Standard(
const Vec2f& axis2d)
const;
101 bool IsOutsideOnRight_Standard(
const Vec2f& axis2d)
const;
102 bool IsStrictlyInHalfPlan(
const Vec2f& refDir,
KyFloat32 rotSign,
const Vec2f& axis2d)
const;
105 void PushApexInDisplayList(
DisplayList& displayList)
const;
121 bool IsInsideFunnel(
const Vec2f& axis2d)
const;
123 void TightenLeftBorder(
const BubbleFunnelBorder& border);
124 void TightenRightBorder(
const BubbleFunnelBorder& border);
125 void PushBorderAsLineInDisplayList(
const BubbleFunnelBorder& border,
DisplayList* displayList,
Color color);
134 FunnelSide m_apexSide;
136 Vec2f m_entryDirMinusFullTurnTolerance;
141 BubbleFunnelBorder m_leftBorder;
142 BubbleFunnelBorder m_rightBorder;
145 FunnelResult m_previousResult;
148 Bubble m_lastAddedCornerBubble;
149 bool m_entryDirPassed;
150 bool m_hasQuitApexBubble;
155 bool m_advancedVisualDebuggingEnabled;
156 const char* m_loopGroupName;
160 KY_INLINE
void BubbleToCornerFunnel::TightenLeftBorder(
const BubbleFunnelBorder& border)
162 if (m_funnelBordersDisplayList)
163 PushBorderAsLineInDisplayList(border, m_funnelBordersDisplayList, Color::Green);
165 m_leftBorder = border;
166 m_previousResult = FunnelTightened;
169 KY_INLINE
void BubbleToCornerFunnel::TightenRightBorder(
const BubbleFunnelBorder& border)
171 if (m_funnelBordersDisplayList)
172 PushBorderAsLineInDisplayList(border, m_funnelBordersDisplayList, Color::Red);
174 m_rightBorder = border;
175 m_previousResult = FunnelTightened;
179 KY_INLINE
bool BubbleToCornerFunnel::IsOutsideOnLeft_Standard(
const Vec2f& axis2d)
const
181 return IsStrictlyInHalfPlan(m_leftBorder.GetSegmentDir2d(), 1.0f, axis2d);
184 KY_INLINE
bool BubbleToCornerFunnel::IsOutsideOnRight_Standard(
const Vec2f& axis2d)
const
186 return IsStrictlyInHalfPlan(m_rightBorder.GetSegmentDir2d(), -1.0f, axis2d);
Game side: Manages all DisplayListData, send them to the NavigationLab.
Definition: displaylist.h:375
Adaptive radius funnel to be used typically to string pull within a Bubble array. ...
Definition: bubbletocornerfunnel.h:72
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
This class encapsulate an array of Bubbles.
Definition: bubblearray.h:22
RotationDirection
Defines the 4 possible cases of possibly constrained rotation in the horizontal plane for a given ele...
Definition: rotation.h:15
This class represents a circle with potential rotation limitation.
Definition: bubble.h:31
2d vector using KyFloat32.
Definition: vec2f.h:18
DisplayList is used to push text, lines or shapes for rendering in the NavigationLab e...
Definition: displaylist.h:128
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
RGBA color.
Definition: color.h:16
float KyFloat32
float
Definition: types.h:32