gwnavruntime/world/botdisplay.h Source File

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