gwnavruntime/world/botdisplay.h Source File

botdisplay.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: LAPA - secondary contact: GUAL
8 #ifndef Navigation_BotDisplay_H
9 #define Navigation_BotDisplay_H
10 
12 #include "gwnavruntime/world/bot.h"
13 
14 namespace Kaim
15 {
16 
17 class ScopedDisplayList;
18 class BotConfigBlob;
19 class LivePathBlob;
20 class PathFollowerBlob;
21 class SpatializationResultBlob;
22 class SpatializedCylinderConfigBlob;
23 class SpatializedCylinderBlob;
24 class PositionOnLivePathBlob;
25 class FrontDirectionBlob;
26 class TrajectoryBlob;
27 
28 
36 class BotColors
37 {
38 public:
39  BotColors()
40  {
41  m_botColor_PathNotFound = VisualColor::Red;
42  m_botColor_ComputingPath = VisualColor::Orange;
43  m_botColor_NoPathSet = VisualColor::Lime;
44  m_botColor_FullPathFollower = VisualColor::Yellow;
45  m_botColor_CustomFollowing = VisualColor::Blue;
46  }
47 
48  // - path status
49  VisualColor m_botColor_PathNotFound;
50  VisualColor m_botColor_ComputingPath;
51  VisualColor m_botColor_NoPathSet;
52  // - pathfollower status
53  VisualColor m_botColor_FullPathFollower;
54  VisualColor m_botColor_CustomFollowing;
55 };
56 
57 
58 // This class is used only in the NavigationLab to build a displayList from all the blob received from the visual debug
59 class VelocityDisplayConfig
60 {
61 public:
62  VelocityDisplayConfig() : m_altitudeRatio(0.0f), m_headWidth(0.0f) {}
63 public:
64  Vec3f m_velocity;
65  VisualShapeColor m_color;
66  KyFloat32 m_altitudeRatio;
67  KyFloat32 m_headWidth;
68 };
69 
70 class BotDisplay
71 {
72 public:
73  BotDisplay(
74  ScopedDisplayList* displayList,
75  const BotConfigBlob* botConfigBlob,
76  const FrontDirectionBlob* frontDirectionBlob,
77  const SpatializedCylinderBlob* spatializedCylinderBlob,
78  const SpatializedCylinderConfigBlob* spatializedCylinderConfigBlob,
79  const PathFollowerBlob* pathFollowerBlob,
80  const SpatializationResultBlob* spatializationResultBlob,
81  const LivePathBlob* livePathBlob)
82  : m_displayList(displayList)
83  , m_botConfigBlob(botConfigBlob)
84  , m_frontDirectionBlob(frontDirectionBlob)
85  , m_spatializedCylinderBlob(spatializedCylinderBlob)
86  , m_spatializedCylinderConfigBlob(spatializedCylinderConfigBlob)
87  , m_pathFollowerBlob(pathFollowerBlob)
88  , m_spatializationResultBlob(spatializationResultBlob)
89  , m_livePathBlob(livePathBlob)
90  {
91  }
92 
93  VisualColor GetBotRenderColor() const;
94 
95  VisualColor GetProgressOnPathColor(const ProgressOnPathStatus status) const;
96 
97  void DisplayProgressOnPath(bool isLodMax) const;
98 
99  void DisplayPositionOnPath(const PositionOnLivePathBlob& positionOnLivePathBlob, VisualColor lineColor, bool isLodMax) const;
100 
101  void DisplayStatus() const;
102 
103  void DisplayFrontDirection(bool displayWireframe) const;
104 
105  void DisplayBotInputVelocity(bool displayWireframe) const;
106 
107  void DisplayBotOutputVelocity(bool displayWireframe) const;
108 
109 private:
110  void DisplayBotVelocity(const VelocityDisplayConfig& velocityDisplayConfig) const;
111 
112 private:
113  ScopedDisplayList* m_displayList;
114  const BotConfigBlob* m_botConfigBlob;
115  const FrontDirectionBlob* m_frontDirectionBlob;
116  const SpatializedCylinderBlob* m_spatializedCylinderBlob;
117  const SpatializedCylinderConfigBlob* m_spatializedCylinderConfigBlob;
118  const PathFollowerBlob* m_pathFollowerBlob;
119  const SpatializationResultBlob* m_spatializationResultBlob;
120  const LivePathBlob* m_livePathBlob;
121  Kaim::BotColors m_botColors;
122 };
123 
124 }
125 
126 #endif
static const VisualColor Blue
Represents the color with RGBA values ( 0, 0, 255, 255).  
Definition: visualcolor.h:105
static const VisualColor Yellow
Represents the color with RGBA values (255, 255, 0, 255).  
Definition: visualcolor.h:236
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
Represents a single RGBA color.
Definition: visualcolor.h:19
static const VisualColor Red
Represents the color with RGBA values (255, 0, 0, 255).  
Definition: visualcolor.h:209
ProgressOnPathStatus
Enumerates the possible status values of Bot Position on path.
Definition: progressonpathstatus.h:14
Definition: gamekitcrowddispersion.h:20
Defines the colors used to render the Bot accordingly to its internal statuses.
Definition: botdisplay.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43