17 class NearestBorderHalfEdgeFromPosQueryDisplayListBuilder :
public IDisplayListBuilder
20 void DrawSearchBox(
const NearestBorderHalfEdgeFromPosQueryBlob* queryBlob,
const Color& color, DisplayList* displayList)
22 Vec3f boxMax(queryBlob->m_inputPos3f);
23 Vec3f boxMin(queryBlob->m_inputPos3f);
24 boxMin.x -= queryBlob->m_horizontalTolerance;
25 boxMin.y -= queryBlob->m_horizontalTolerance;
26 boxMin.z -= queryBlob->m_positionSpatializationRange.m_rangeBelowPosition;
28 boxMax.x += queryBlob->m_horizontalTolerance;
29 boxMax.y += queryBlob->m_horizontalTolerance;
30 boxMax.z += queryBlob->m_positionSpatializationRange.m_rangeAbovePosition;
32 ShapeColor shapeColor;
33 shapeColor.m_lineColor = color;
34 displayList->PushBox(Box3f(boxMin, boxMax), shapeColor);
37 virtual void DoBuild(DisplayList* displayList,
char* blob)
39 const NearestBorderHalfEdgeFromPosQueryBlob* query = (NearestBorderHalfEdgeFromPosQueryBlob*) blob;
40 NearestBorderHalfEdgeFromPosQueryOutputBlob* output = query->m_queryOutput.Ptr();
41 if (output ==
nullptr)
51 displayList->PushPoint(query->m_inputPos3f, flagRadius, Color::Orange);
52 DrawSearchBox(query, Color::Orange, displayList);
57 DrawSearchBox(query, Color::Red, displayList);
62 displayList->PushText(query->m_inputPos3f.OffsetZ(1.0f), Color::Red,
"Lack of memory");
63 DrawSearchBox(query, Color::Red, displayList);
68 DrawSearchBox(query, Color::LightGreen, displayList);
70 Color nearest_color = Color::Green;
71 Color side_color = Color::Orange;
73 const Vec3f& start = output->m_nearestHalfEdgeOnBorder.m_startPos3f;
74 const Vec3f& end = output->m_nearestHalfEdgeOnBorder.m_endPos3f;
76 const Vec3f& prev_start = output->m_prevHalfEdgeOnBorder.m_startPos3f;
77 const Vec3f& prev_end = output->m_prevHalfEdgeOnBorder.m_endPos3f;
78 const Vec3f& prev_middle = (prev_start + prev_end) * 0.5f;
80 const Vec3f& next_start = output->m_nextHalfEdgeOnBorder.m_startPos3f;
81 const Vec3f& next_end = output->m_nextHalfEdgeOnBorder.m_endPos3f;
82 const Vec3f& next_middle = (next_start + next_end) * 0.5f;
85 displayList->PushPoint(output->m_nearestPosOnHalfEdge, flagRadius, nearest_color);
87 displayList->PushArrow2d5(query->m_inputPos3f, output->m_nearestPosOnHalfEdge, nearest_color);
88 displayList->PushText(output->m_nearestPosOnHalfEdge.OffsetZ(1.0f), nearest_color,
"Nearest half edge");
89 displayList->PushLine(start, end, nearest_color);
92 displayList->PushLine(prev_start, prev_end, side_color);
93 displayList->PushArrow2d5(query->m_inputPos3f, prev_middle, side_color);
94 displayList->PushText(prev_middle.OffsetZ(1.0f), side_color,
"Prev");
96 displayList->PushLine(next_start, next_end, side_color);
97 displayList->PushArrow2d5(query->m_inputPos3f, next_middle, side_color);
98 displayList->PushText(next_middle.OffsetZ(1.0f), side_color,
"Next");
Indicates that the query was completed successfully, and a NavMesh border was found.
Definition: basenearestborderhalfedgefromposquery.h:28
Indicates that a NavMesh border was not found within the query's bounding box.
Definition: basenearestborderhalfedgefromposquery.h:25
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that insufficient working memory caused the query to stop.
Definition: basenearestborderhalfedgefromposquery.h:26
NearestBorderHalfEdgeFromPosQueryResult
Enumerates the possible results of a NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:20
Indicates the query has not yet been initialized.
Definition: basenearestborderhalfedgefromposquery.h:22
Indicates the query has not yet been launched.
Definition: basenearestborderhalfedgefromposquery.h:23
float KyFloat32
float
Definition: types.h:32