gwnavruntime/collision/collisionraycastquerydisplaylistbuilder.h Source File

collisionraycastquerydisplaylistbuilder.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: JAPA - secondary contact: NOBODY
8 #ifndef Navigation_CollisionRayCastQuery_DisplayListBuilder_H
9 #define Navigation_CollisionRayCastQuery_DisplayListBuilder_H
10 
13 
14 namespace Kaim
15 {
16 
17 class CollisionRayCastQueryDisplayListBuilder : public IDisplayListBuilder
18 {
19 private:
20  virtual void DoBuild(ScopedDisplayList* displayList, char* blob, KyUInt32 /*deepBlobSize*/ = 0)
21  {
22  const CollisionRayCastQueryBlob* queryBlob = (CollisionRayCastQueryBlob*)blob;
23 
24  CollisionRayCastQueryOutputBlob* queryOutputBlob = queryBlob->m_queryOutput.Ptr();
25  if (queryOutputBlob != NULL)
26  {
27  float arrowHalfWidth = 0.05f;
28 
29  VisualShapeColor rayShapeColor;
30  VisualShapeColor triangleShapeColor;
31 
32  switch(queryOutputBlob->GetResult())
33  {
34  case RayHit:
35  {
36  rayShapeColor.m_triangleColor = VisualColor::Red;
37  displayList->PushArrow(queryBlob->m_startPos3f, queryBlob->m_endPos3f, arrowHalfWidth, rayShapeColor, 3.0f, 0.1f);
38  displayList->PushLine(queryBlob->m_startPos3f, queryBlob->m_endPos3f, rayShapeColor.m_triangleColor);
39  }
40  break;
41  case RayDidNotHit:
42  {
43  rayShapeColor.m_triangleColor = VisualColor::Lime;
44  displayList->PushArrow(queryBlob->m_startPos3f, queryBlob->m_endPos3f, arrowHalfWidth, rayShapeColor, 3.0f, 0.1f);
45  displayList->PushLine(queryBlob->m_startPos3f, queryBlob->m_endPos3f, rayShapeColor.m_triangleColor);
46  }
47  break;
48  default:
49  break;
50  }
51  }
52  }
53 };
54 
55 }
56 
57 #endif // Navigation_CollisionRayCastQuery_DisplayListBuilder_H
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 Red
Represents the color with RGBA values (255, 0, 0, 255).  
Definition: visualcolor.h:209
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36