gwnavruntime/queries/blobs/diskcollisionquerydisplaylistbuilder.h Source File

diskcollisionquerydisplaylistbuilder.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
11 
12 namespace Kaim
13 {
14 
15 class DiskCollisionQueryDisplayListBuilder : public QueryDisplayListBuilder<DiskCollisionQueryBlob, DiskCollisionQueryOutputBlob, DiskCollisionQueryDisplayListBuilder>
16 {
17 public:
18  void DoPushQueryShape(Color color)
19  {
20  m_displayList->PushPointLine2d(m_query->m_centerPos3f, m_query->m_radius, color);
21  m_displayList->PushDisk(m_query->m_centerPos3f, m_query->m_radius, color);
22  }
23 
24  const Vec3f& DoGetStartPos()
25  {
26  return m_query->m_centerPos3f;
27  }
28 
29  void DoPushStartTriangle(Color color)
30  {
31  m_displayList->PushTriangle(m_output->m_centerTriangle.m_triangle.OffsetZ(0.1f), color);
32  }
33 
34  void Push_DISK_DOES_NOT_FIT()
35  {
36  DoPushQueryShape(Color::Red);
37  }
38 
39  void Push_DISK_FIT()
40  {
41  DoPushQueryShape(Color::Green);
42  }
43 
44 private:
45  virtual void DoBuild(DisplayList* displayList, char* blob)
46  {
47  if (Init(displayList, blob) == false)
48  return;
49 
50  switch ((DiskCollisionQueryResult)m_output->m_result)
51  {
53  case DISKCOLLISION_NOT_PROCESSED: Push_NOT_PROCESSED(); break;
54  case DISKCOLLISION_DONE_CENTER_OUTSIDE: Push_START_OUTSIDE(); break;
55  case DISKCOLLISION_DONE_CENTER_NAVTAG_FORBIDDEN: Push_START_NAVTAG_FORBIDDEN(); break;
56  case DISKCOLLISION_DONE_LACK_OF_WORKING_MEMORY: Push_LACK_OF_WORKING_MEMORY(); break;
57  case DISKCOLLISION_DONE_UNKNOWN_ERROR: Push_UNKNOWN_ERROR(); break;
58  case DISKCOLLISION_DONE_DISK_DOES_NOT_FIT: Push_DISK_DOES_NOT_FIT(); break;
59  case DISKCOLLISION_DONE_DISK_FIT: Push_DISK_FIT(); break;
60  }
61 
62  PushDynamicOutput();
63  }
64 };
65 
66 }
67 
Indicates that an unknown error occurred during the query processing.
Definition: basediskcollisionquery.h:27
Indicates that the center point lies inside the NavMesh, but that the radius collides with a border o...
Definition: basediskcollisionquery.h:25
Indicates that the center point lies outside the navigable area of the NavMesh.
Definition: basediskcollisionquery.h:23
Indicates that the disk fits inside the navigable area of the NavMesh.
Definition: basediskcollisionquery.h:29
DiskCollisionQueryResult
Enumerates the possible results of a DiskCollisionQuery.
Definition: basediskcollisionquery.h:18
Indicates that insufficient working memory caused the query to stop.
Definition: basediskcollisionquery.h:26
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the query has not yet been launched.
Definition: basediskcollisionquery.h:21
Indicates that the NavTag at the center point was forbidden.
Definition: basediskcollisionquery.h:24
Indicates that the query has not yet been initialized.
Definition: basediskcollisionquery.h:20