8 #ifndef Navigation_BestGraphVertexPathFinderQuery_DisplayListBuilder_H
9 #define Navigation_BestGraphVertexPathFinderQuery_DisplayListBuilder_H
20 class BestGraphVertexPathFinderQueryDisplayListBuilder :
public IDisplayListBuilder
23 static void BuildPropagationCylinder(ScopedDisplayList* displayList,
const Vec3f& center,
KyFloat32 radius)
25 VisualShapeColor shapeColor;
32 const KyUInt32 subdivisionCount = 14;
33 const KyFloat32 angleStep = ((float)(KY_MATH_PI) * 2.0f) / subdivisionCount;
34 const KyFloat32 cosAngleStep = Cosf(angleStep);
35 const KyFloat32 sinAngleStep = Sinf(angleStep);
36 const KyFloat32 cosAngleHalfStep = Cosf(angleStep*0.5f);
37 const KyFloat32 sinAngleHalfStep = Sinf(angleStep*0.5f);
38 const Vec3f heightVector(0.0f, 0.0f, heigth);
40 Vec2f curStepDir(1.0f, 0.0f);
41 Vec3f v0 = P + radius * curStepDir;
42 for(
KyUInt32 i = 0; i < subdivisionCount; i++)
45 const KyFloat32 formerDirX = curStepDir.x;
48 planeDir.x = cosAngleHalfStep * formerDirX - sinAngleHalfStep * curStepDir.y;
49 planeDir.y = sinAngleHalfStep * formerDirX + cosAngleHalfStep * curStepDir.y;
51 curStepDir.x = cosAngleStep * formerDirX - sinAngleStep * curStepDir.y;
52 curStepDir.y = sinAngleStep * formerDirX + cosAngleStep * curStepDir.y;
55 const Vec3f v1 = P + radius * curStepDir;
57 displayList->PushQuad(v0, v1, v1 + heightVector, v0 + heightVector, shapeColor);
61 AStarQueryDisplayListBuilder::BuildVerticalForbiddenWallLogo(
62 displayList, v0, v1, v1 + heightVector, v0 + heightVector, planeDir.PerpCCW());
70 virtual void DoBuild(ScopedDisplayList* displayList,
char* blob,
KyUInt32 )
72 const BestGraphVertexPathFinderQueryBlob* bestGraphVertexPathFinderQueryBlob = (BestGraphVertexPathFinderQueryBlob*) blob;
74 BestGraphVertexPathFinderQueryOutputBlob* bestGraphVertexPathFinderQueryOutputBlob = bestGraphVertexPathFinderQueryBlob->m_queryOutput.Ptr();
75 if (bestGraphVertexPathFinderQueryOutputBlob != NULL)
98 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Start outside!");
103 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Start NavTag forbidden!");
108 BuildPropagationCylinder(displayList, bestGraphVertexPathFinderQueryBlob->m_startPos3f,
109 bestGraphVertexPathFinderQueryBlob->m_propagationRadius);
110 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Path not found !");
115 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"NavData changed!");
120 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Lack of working memory!");
125 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Computation Error");
130 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Channel Config Error");
136 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Channel Computation Error");
141 PathDisplayListBuilder pathDisplayListBuilder;
142 pathDisplayListBuilder.DisplayPath(displayList, &bestGraphVertexPathFinderQueryOutputBlob->m_pathBlob);
147 displayList->PushText(bestGraphVertexPathFinderQueryBlob->m_startPos3f + offsetVector, textColor,
"Query Canceled");
Indicates that the input channelComputerConfig is invalid.
Definition: basebestgraphvertexpathfinderquery.h:43
static const VisualColor Black
Represents the color with RGBA values ( 0, 0, 0, 255).
Definition: visualcolor.h:103
Indicates the query has not yet been initialized.
Definition: basebestgraphvertexpathfinderquery.h:24
Indicates the query has not yet been launched.
Definition: basebestgraphvertexpathfinderquery.h:25
static const VisualColor Red
Represents the color with RGBA values (255, 0, 0, 255).
Definition: visualcolor.h:209
Indicates that the astar traversal algorithm has been launched, but has not yet completed.
Definition: basebestgraphvertexpathfinderquery.h:27
Indicates that insufficient working memory caused the query to stop.
Definition: basebestgraphvertexpathfinderquery.h:41
Indicates that the computation has been canceled.
Definition: basebestgraphvertexpathfinderquery.h:45
Indicates that the refiner is done, the channel is going to be initialized.
Definition: basebestgraphvertexpathfinderquery.h:34
static Vec3f UnitZ()
Returns the normalized orientation of the Z axis.
Definition: vec3f.h:218
Indicates that the refining process is being initialized.
Definition: basebestgraphvertexpathfinderquery.h:29
static const VisualColor DimGray
Represents the color with RGBA values (105, 105, 105, 255).
Definition: visualcolor.h:136
Indicates that the refined path is being clamped to navMesh according to the altitude tolerance...
Definition: basebestgraphvertexpathfinderquery.h:32
Definition: gamekitcrowddispersion.h:20
Indicates that the clamping algorithm has completed, but the path has not yet been built...
Definition: basebestgraphvertexpathfinderquery.h:33
Indicates that the NavTag at the starting point is forbidden.
Definition: basebestgraphvertexpathfinderquery.h:38
Indicates that a path has been found between the start and destination.
Definition: basebestgraphvertexpathfinderquery.h:47
Indicates that a path could not be found between the start and destination points.
Definition: basebestgraphvertexpathfinderquery.h:39
Indicates that the channel is initialized, the channel is being computed.
Definition: basebestgraphvertexpathfinderquery.h:35
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Indicates that a computation error caused the query to stop.
Definition: basebestgraphvertexpathfinderquery.h:44
Indicates that the astar traversal algorithm is finished, and that the path found is ready to be refi...
Definition: basebestgraphvertexpathfinderquery.h:28
BestGraphVertexPathFinderQueryResult
Enumerates the possible results of an BestGraphVertexPathFinderQuery.
Definition: basebestgraphvertexpathfinderquery.h:22
Indicates that the path found is being refined.
Definition: basebestgraphvertexpathfinderquery.h:30
Indicates that the query has stopped and must be relaunched because of a change in the NavData...
Definition: basebestgraphvertexpathfinderquery.h:40
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basebestgraphvertexpathfinderquery.h:37
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
Indicates that the refiner is done, but the path has not yet been clamped to the navMesh.
Definition: basebestgraphvertexpathfinderquery.h:31
Indicates that a computation error caused the query to stop.
Definition: basebestgraphvertexpathfinderquery.h:42