gwnavruntime/queries/blobs/spatializedpointsinaabbfromposquerydisplaylistbuilder.h Source File

spatializedpointsinaabbfromposquerydisplaylistbuilder.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 // Primary contact: MAMU - secondary contact: NOBODY
8 #ifndef Navigation_SpatializedPointsInAabbFromPosQuery_DisplayListBuilder_H
9 #define Navigation_SpatializedPointsInAabbFromPosQuery_DisplayListBuilder_H
10 
14 
15 namespace Kaim
16 {
17 
18 class SpatializedPointCollectorInAABBQueryDisplayListBuilder : public IDisplayListBuilder
19 {
20 private:
21  virtual void DoBuild(ScopedDisplayList* displayList, char* blob, KyUInt32 /*deepBlobSize*/ = 0)
22  {
23  const SpatializedPointCollectorInAABBQueryBlob* queryBlob = (SpatializedPointCollectorInAABBQueryBlob*) blob;
24 
25  SpatializedPointCollectorInAABBQueryOutputBlob* queryOutputBlob = queryBlob->m_queryOutput.Ptr();
26  if (queryOutputBlob != NULL)
27  {
28  Vec3f offsetVector = Vec3f::UnitZ();
29  Box3f aabb(queryBlob->m_startPos3f, queryBlob->m_startPos3f);
30  aabb.m_min -= queryBlob->m_extentBox.m_min;
31  aabb.m_max += queryBlob->m_extentBox.m_max;
32 
33  VisualShapeColor shapeColor;
34  switch((SpatializedPointCollectorInAABBQueryResult)queryOutputBlob->m_result)
35  {
38  {
39  shapeColor.m_lineColor = VisualColor::Orange;
40  displayList->PushBox(aabb, shapeColor);
41  }
42  break;
44  {
45  shapeColor.m_lineColor = VisualColor::Red;
46  displayList->PushBox(aabb, shapeColor);
47  }
48  break;
50  {
51  shapeColor.m_lineColor = VisualColor::Red;
52  displayList->PushBox(aabb, shapeColor);
53 
54  shapeColor.m_lineColor = VisualColor::Lime;
55  displayList->PushTriangle(queryOutputBlob->m_startTriangle.m_triangle, shapeColor);
56  displayList->PushText(queryBlob->m_startPos3f + offsetVector, shapeColor.m_lineColor, "Lack of working memory!");
57  }
58  break;
60  {
61  shapeColor.m_lineColor = VisualColor::LightGreen;
62  displayList->PushBox(aabb, shapeColor);
63 
64  shapeColor.m_lineColor = VisualColor::Lime;
65  displayList->PushTriangle(queryOutputBlob->m_startTriangle.m_triangle, shapeColor);
66 
67  shapeColor.SetOnlyTriangleColor(VisualColor::Lime);
68  SpatializedPointBlob* points = queryOutputBlob->m_queryDynamicOutputBlob.m_spatializedPoints.GetValues();
69  for (KyUInt32 i = 0; i < queryOutputBlob->m_queryDynamicOutputBlob.m_spatializedPoints.GetCount(); ++i)
70  {
71  displayList->PushPoint(points[i].m_position, shapeColor);
72  displayList->PushText(points[i].m_position + offsetVector, shapeColor.m_triangleColor, SpatializedPoint::GetObjectTypeDescrition((SpatializedPointObjectType)points[i].m_type));
73  }
74  }
75  break;
76  }
77  }
78  }
79 };
80 
81 }
82 
83 #endif
Indicates that insufficient working memory caused the query to stop.
Definition: basespatializedpointcollectorinaabbquery.h:32
Definition: SF_RefCount.h:377
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
SpatializedPointCollectorInAABBQueryResult
Enumerates the possible results of a SpatializedPointCollectorInAABBQuery.
Definition: basespatializedpointcollectorinaabbquery.h:26
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basespatializedpointcollectorinaabbquery.h:31
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
SpatializedPointObjectType
Enumerates the possible object types the SpatializedPoint refers to.
Definition: spatializedpoint.h:35
Definition: gamekitcrowddispersion.h:20
Indicates that the query was completed successfully.
Definition: basespatializedpointcollectorinaabbquery.h:34
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Indicates that the query has not yet been launched.
Definition: basespatializedpointcollectorinaabbquery.h:29
Indicates that the query has not yet been initialized.
Definition: basespatializedpointcollectorinaabbquery.h:28