8 #ifndef Navigation_NearestBorderHalfEdgeFromPosQuery_DisplayListBuilder_H
9 #define Navigation_NearestBorderHalfEdgeFromPosQuery_DisplayListBuilder_H
19 class NearestBorderHalfEdgeFromPosQueryDisplayListBuilder :
public IDisplayListBuilder
22 void DrawSearchBox(
const NearestBorderHalfEdgeFromPosQueryBlob* queryBlob,
const VisualColor& color, ScopedDisplayList* displayList)
24 Vec3f boxMax(queryBlob->m_inputPos3f);
25 Vec3f boxMin(queryBlob->m_inputPos3f);
26 boxMin.x -= queryBlob->m_horizontalTolerance;
27 boxMin.y -= queryBlob->m_horizontalTolerance;
28 boxMin.z -= queryBlob->m_positionSpatializationRange.m_rangeBelowPosition;
30 boxMax.x += queryBlob->m_horizontalTolerance;
31 boxMax.y += queryBlob->m_horizontalTolerance;
32 boxMax.z += queryBlob->m_positionSpatializationRange.m_rangeAbovePosition;
34 VisualShapeColor shapeColor;
35 shapeColor.m_lineColor = color;
36 displayList->PushBox(Box3f(boxMin, boxMax), shapeColor);
39 virtual void DoBuild(ScopedDisplayList* displayList,
char* blob,
KyUInt32 = 0)
41 const NearestBorderHalfEdgeFromPosQueryBlob* queryBlob = (NearestBorderHalfEdgeFromPosQueryBlob*) blob;
43 NearestBorderHalfEdgeFromPosQueryOutputBlob* queryOutputBlob = queryBlob->m_queryOutput.Ptr();
44 if (queryOutputBlob != NULL)
49 VisualShapeColor shapeColor;
56 displayList->PushPoint(queryBlob->m_inputPos3f, flagRadius, shapeColor);
67 displayList->PushText(queryBlob->m_inputPos3f + offsetVector,
VisualColor::Red,
"Lack of memory");
75 displayList->PushPoint(queryOutputBlob->m_nearestPosOnHalfEdge, flagRadius, shapeColor);
79 displayList->PushArrow(queryBlob->m_inputPos3f, queryOutputBlob->m_nearestPosOnHalfEdge, 0.05f, shapeColor);
80 displayList->PushText(queryOutputBlob->m_nearestPosOnHalfEdge + offsetVector, shapeColor.m_triangleColor,
"Nearest half edge");
81 displayList->PushLine(queryOutputBlob->m_nearestHalfEdgeOnBorder.m_startPos3f, queryOutputBlob->m_nearestHalfEdgeOnBorder.m_endPos3f,
82 shapeColor.m_triangleColor);
86 Vec3f prevHalfEdgeMiddle = (queryOutputBlob->m_prevHalfEdgeOnBorder.m_startPos3f + queryOutputBlob->m_prevHalfEdgeOnBorder.m_endPos3f) * 0.5f;
87 displayList->PushLine(queryOutputBlob->m_prevHalfEdgeOnBorder.m_startPos3f, queryOutputBlob->m_prevHalfEdgeOnBorder.m_endPos3f,
88 shapeColor.m_triangleColor);
89 displayList->PushArrow(queryBlob->m_inputPos3f, prevHalfEdgeMiddle, 0.01f, shapeColor);
90 displayList->PushText(prevHalfEdgeMiddle + offsetVector, shapeColor.m_triangleColor,
"Prev");
92 Vec3f nextHalfEdgeMiddle = (queryOutputBlob->m_nextHalfEdgeOnBorder.m_startPos3f + queryOutputBlob->m_nextHalfEdgeOnBorder.m_endPos3f) * 0.5f;
93 displayList->PushLine(queryOutputBlob->m_nextHalfEdgeOnBorder.m_startPos3f, queryOutputBlob->m_nextHalfEdgeOnBorder.m_endPos3f,
94 shapeColor.m_triangleColor);
95 displayList->PushArrow(queryBlob->m_inputPos3f, nextHalfEdgeMiddle, 0.01f, shapeColor);
96 displayList->PushText(nextHalfEdgeMiddle + offsetVector, shapeColor.m_triangleColor,
"Next");
Indicates that the query was completed successfully, and a NavMesh border was found.
Definition: basenearestborderhalfedgefromposquery.h:37
Indicates that a NavMesh border was not found within the query's bounding box.
Definition: basenearestborderhalfedgefromposquery.h:34
static const VisualColor Lime
Represents the color with RGBA values ( 0, 255, 0, 255).
Definition: visualcolor.h:172
static const VisualColor Orange
Represents the color with RGBA values (255, 165, 0, 255).
Definition: visualcolor.h:195
static const VisualColor Red
Represents the color with RGBA values (255, 0, 0, 255).
Definition: visualcolor.h:209
static const VisualColor LightGreen
Represents the color with RGBA values (144, 238, 144, 255).
Definition: visualcolor.h:164
static Vec3f UnitZ()
Returns the normalized orientation of the Z axis.
Definition: vec3f.h:218
Definition: gamekitcrowddispersion.h:20
Indicates that insufficient working memory caused the query to stop.
Definition: basenearestborderhalfedgefromposquery.h:35
NearestBorderHalfEdgeFromPosQueryResult
Enumerates the possible results of a NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:29
Indicates the query has not yet been initialized.
Definition: basenearestborderhalfedgefromposquery.h:31
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Indicates the query has not yet been launched.
Definition: basenearestborderhalfedgefromposquery.h:32
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43