gwnavruntime/queries/blobs/segmentcastquerydisplaylistbuilder.h Source File

segmentcastquerydisplaylistbuilder.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 SegmentCastQueryDisplayListBuilder : public QueryDisplayListBuilder<SegmentCastQueryBlob, SegmentCastQueryOutputBlob, SegmentCastQueryDisplayListBuilder>
16 {
17 public:
18  void DoPushQueryShape(Color color)
19  {
20  m_displayList->PushSegmentQuad2d5(m_query->m_startPos3f, m_query->m_startPos3f + m_query->m_normalizedDir2d * m_query->m_maxDist, m_query->m_radius, color);
21  }
22 
23  void DoPushShapeToArrival(Color color)
24  {
25  m_displayList->PushSegmentQuad2d5(m_query->m_startPos3f, m_output->m_arrivalPos3f, m_query->m_radius, color);
26  }
27 
28 private:
29  virtual void DoBuild(DisplayList* displayList, char* blob)
30  {
31  if (Init(displayList, blob) == false)
32  return;
33 
34  switch ((SegmentCastQueryResult)m_output->m_result)
35  {
36  case SEGMENTCAST_NOT_INITIALIZED: break;
37  case SEGMENTCAST_NOT_PROCESSED: Push_NOT_PROCESSED(); break;
38  case SEGMENTCAST_DONE_START_OUTSIDE: Push_START_OUTSIDE(); break;
39  case SEGMENTCAST_DONE_START_NAVTAG_FORBIDDEN: Push_START_NAVTAG_FORBIDDEN(); break;
40  case SEGMENTCAST_DONE_CANNOT_MOVE: Push_CANNOT_MOVE(); break;
41  case SEGMENTCAST_DONE_COLLISION_FOUND_ARRIVAL_ERROR: Push_ARRIVAL_ERROR(); break;
42  case SEGMENTCAST_DONE_LACK_OF_WORKING_MEMORY: Push_LACK_OF_WORKING_MEMORY(); break;
43  case SEGMENTCAST_DONE_UNKNOWN_ERROR: Push_UNKNOWN_ERROR(); break;
44  case SEGMENTCAST_DONE_ARRIVALPOS_FOUND_MAXDIST_REACHED: Push_MAXDIST_REACHED(); break;
45  case SEGMENTCAST_DONE_ARRIVALPOS_FOUND_WITH_COLLISION: Push_COLLISION(); break;
46  }
47 
48  PushDynamicOutput();
49  }
50 };
51 
52 }
53 
Indicates that insufficient working memory caused the query to stop.
Definition: basesegmentcastquery.h:30
Indicates that an error occured during the query computation.
Definition: basesegmentcastquery.h:31
Indicates that the NavTag at the starting point was forbidden.
Definition: basesegmentcastquery.h:27
Indicates that the query has not yet been initialized.
Definition: basesegmentcastquery.h:23
Indicates that a final arrival position was calculated successfully.
Definition: basesegmentcastquery.h:34
Indicates that the query has not yet been launched.
Definition: basesegmentcastquery.h:24
SegmentCastQueryResult
Enumerates the possible results of a SegmentCastQuery.
Definition: basesegmentcastquery.h:21
Indicates that moving back the collision point resulted in an arrival position that is outside of the...
Definition: basesegmentcastquery.h:29
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basesegmentcastquery.h:26
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the segment was able to travel its maximum distance without collision.
Definition: basesegmentcastquery.h:33
Indicates that the starting point is very close to a NavMesh border. Either the segment does not fit ...
Definition: basesegmentcastquery.h:28