gwnavruntime/queries/blobs/raycastquerydisplaylistbuilder.h Source File

raycastquerydisplaylistbuilder.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 
12 
13 namespace Kaim
14 {
15 
16 class DisplayList;
17 
18 class RayCastQueryDisplayListBuilder : public QueryDisplayListBuilder<RayCastQueryBlob, RayCastQueryOutputBlob, RayCastQueryDisplayListBuilder>
19 {
20 public:
21  void DoPushQueryShape(Color color)
22  {
23  m_displayList->PushArrow2d5(m_query->m_startPos3f, m_query->m_startPos3f + m_query->m_maxMove2D, color);
24  }
25 
26  void DoPushShapeToArrival(Color color)
27  {
28  m_displayList->PushArrow2d5(m_query->m_startPos3f, m_output->m_arrivalPos3f, color);
29  }
30 
31 private:
32  void Push_QUERY_TOO_LONG()
33  {
34  PushStartText(Color::Red, "Query too long!");
35  PushQueryShape(Color::Red);
36  }
37 
38  virtual void DoBuild(DisplayList* displayList, char* blob)
39  {
40  if (Init(displayList, blob) == false)
41  return;
42 
43  switch ((RayCastQueryResult)m_output->m_result)
44  {
45  case RAYCAST_NOT_INITIALIZED: break;
46  case RAYCAST_NOT_PROCESSED: Push_NOT_PROCESSED(); break;
47  case RAYCAST_DONE_START_OUTSIDE: Push_START_OUTSIDE(); break;
48  case RAYCAST_DONE_START_NAVTAG_FORBIDDEN: Push_START_NAVTAG_FORBIDDEN(); break;
49  case RAYCAST_DONE_CANNOT_MOVE: Push_CANNOT_MOVE(); break;
50  case RAYCAST_DONE_COLLISION_FOUND_ARRIVAL_ERROR: Push_ARRIVAL_ERROR(); break;
51  case RAYCAST_DONE_LACK_OF_WORKING_MEMORY: Push_LACK_OF_WORKING_MEMORY(); break;
52  case RAYCAST_DONE_UNKNOWN_ERROR: Push_UNKNOWN_ERROR(); break;
53  case RAYCAST_DONE_ARRIVALPOS_FOUND_MAXDIST_REACHED: Push_MAXDIST_REACHED(); break;
54  case RAYCAST_DONE_ARRIVALPOS_FOUND_WITH_COLLISION: Push_COLLISION(); break;
55  case RAYCAST_DONE_QUERY_TOO_LONG: Push_QUERY_TOO_LONG(); break; // very specific to the RayCastQuery
56  }
57 
58  PushDynamicOutput();
59  }
60 };
61 
62 
63 
64 }
65 
Indicates that the query has not yet been initialized.
Definition: baseraycastquery.h:26
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: baseraycastquery.h:30
Indicates that an unknown error occurred during the query processing.
Definition: baseraycastquery.h:35
Indicates that the query was not performed, because the value of BaseRayCastQuery::m_maxDist is large...
Definition: baseraycastquery.h:34
Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.
Definition: baseraycastquery.h:33
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycastquery.h:37
RayCastQueryResult
Enumerates the possible results of a RayCastQuery.
Definition: baseraycastquery.h:24
Indicates that a collision point was found, but moving back from that point resulted in an arrival po...
Definition: baseraycastquery.h:32
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseraycastquery.h:29
Indicates that a collision point was found and that a final arrival position was calculated successfu...
Definition: baseraycastquery.h:38
Indicates that the query has not yet been launched.
Definition: baseraycastquery.h:27
Indicates that the starting point is very close to a NavMesh border, such that moving back the collis...
Definition: baseraycastquery.h:31