VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
navBot.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 
10 #pragma once
11 
13 #include <string>
14 #include "matrix/vlVector.h"
15 
17 {
20 
21  DtNavTagAndLocation(const DtNavTag& t, const DtVector& l) : navTag(t), location(l) {}
23 };
24 typedef std::vector<DtNavTagAndLocation> DtNavTagAndLocationList;
25 typedef unsigned int DtNavigationPriorityType;
26 
28 {
29 public:
31  {
32  NavigationMethodShortcut = 0,
33  NavigationMethodSpline = 1
34  };
35 
37  {
39  : myNavigationMethod(NavigationMethodShortcut)
40  , myUseAbstractGraph(true)
41  , myMinAbstractGraphReplanDistance(100.)
42  , myPropagationBoxExtent(200.)
43  , myRadiusFactor(1.0)
44  {}
45 
60  };
61 
63  {
66  : myEnableAvoidance(true)
67  , myEnableStop(true)
68  , myEnableSlowDown(true)
69  , myEnablePushThrough(false)
70  , myEnableNavigation(true)
71  , myCollisionLookaheadTime(15.)
72  , myCollisionDetectionRadius(15.)
73  , myAngleEvalSpan(120)
74  , myNumAngleSamples(30)
75  , mySafetyDistance((float)0.1)
76  , myCollisionAvoidanceInfluence((float)0.8)
77  {}
78 
90  };
91 
92  typedef DtNavBot* (*DtNavBotCreatorFcn)();
93 
94  static DtNavBot* create();
95  static void setNavBotCreatorFcn(DtNavBotCreatorFcn fcn);
96 
97  virtual ~DtNavBot() {};
98 
99  virtual void init(DtNavArea* world, const DtString& profile, double radius, double height, DtNavigationPriorityType queryQueuePriority,
100  NavigationConfiguration navConfig = NavigationConfiguration(),
101  CollisionAvoidanceConfiguration collAvoidConfig = CollisionAvoidanceConfiguration()) = 0;
102 
103  virtual void setPosition(const DtVector& localPos) = 0;
104  virtual void setPositionInvalid() = 0;
105  virtual void setQueryQueuePriority(const DtNavigationPriorityType& queryQueuePriority) = 0;
106  virtual void botUpdate(const DtVector& localPos, double dT) = 0;
107 
108  virtual void setDestination(const DtVector& localPos, bool forceOutsideArea = false) = 0;
109  virtual void setDesiredSpeed(double speed) = 0;
110  virtual void clearFollowedPath() = 0;
111  virtual void clearDestination() = 0;
112 
113  virtual void moveAlongPath(const std::vector<DtVector>&) = 0;
114 
115  virtual DtVector getOutputVelocity() = 0;
116 
117  typedef bool (*DtNavBotPathLocationEvalFcn)(const DtNavTag& navTag, float* costMultiplier, void* userData);
118 
119  virtual void setPathEvalFcn(DtNavBotPathLocationEvalFcn fcn, void* user) = 0;
120 
122  {
132  };
133 
134  virtual PathStatus pathStatus(double atDistance) = 0;
136  virtual DtString pathStatusString() = 0;
137 
138  virtual bool hasArrived(double arrivalDistance) = 0;
139 
140  virtual bool currentPath(std::vector<DtVector>& path) = 0;
141  virtual bool abstractPath(std::vector<DtVector>& path) = 0;
142 
143  virtual bool currentPathEdge(DtVector& edgeStart, DtVector& edgeEnd) = 0;
144 
145  virtual unsigned currentAbstractPathIndex() = 0;
146 
148  virtual DtNavTag navTagAtPosition(const DtVector& localPos) const = 0;
149 
151  virtual DtNavTag upcomingNavTagOnPath() const = 0;
152 
154  virtual void upcomingNavTagsOnPath(double distance, DtNavTagAndLocationList& navTags) const = 0;
155 
158  virtual void setCollisionAvoidanceEnabled(bool enable) = 0;
159 
160  virtual void setNavigationMethod(NavigationMethod navMethod) = 0;
161  virtual NavigationMethod navigationMethod() const = 0;
162 
165  virtual DtVector performMovement(double dt) = 0;
166 
169  virtual DtVector groundClamp(const DtVector& localPos, DtVector& normal) = 0;
170 
171 protected:
172  static DtNavBotCreatorFcn theNavBotCreatorFcn;
173 };
float myCollisionAvoidanceInfluence
Definition: navBot.h:89
Has a valid path to move along.
Definition: navBot.h:126
bool myEnablePushThrough
Definition: navBot.h:82
static DtNavBotCreatorFcn theNavBotCreatorFcn
Definition: navBot.h:172
float mySafetyDistance
Definition: navBot.h:88
bool myEnableAvoidance
Definition: navBot.h:79
Has arrived at destination.
Definition: navBot.h:127
Not actively trying to move.
Definition: navBot.h:124
double myMinAbstractGraphReplanDistance
Only relevant if using abstract graphs.
Definition: navBot.h:52
Wrapper for GameWare NavTag.
Definition: navDataTag.h:54
bool myEnableSlowDown
Definition: navBot.h:81
NavigationConfiguration()
Definition: navBot.h:38
float myCollisionLookaheadTime
Definition: navBot.h:84
bool myEnableNavigation
Definition: navBot.h:83
double myRadiusFactor
Factor multiplied by the bounding volume radius to generate the nav bot&#39;s radius. ...
Definition: navBot.h:59
Failed to calculate a path.
Definition: navBot.h:128
float myAngleEvalSpan
Definition: navBot.h:86
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points.
int myNumAngleSamples
Definition: navBot.h:87
Contains all the data and logic for navigation within a specific area.
Definition: navArea.h:179
DtVector location
Definition: navBot.h:19
Currently computing a path.
Definition: navBot.h:125
Failed to calculate a path, destination is outside nav.
Definition: navBot.h:131
float myCollisionDetectionRadius
Definition: navBot.h:85
DtNavTag navTag
Definition: navBot.h:18
Definition: navBot.h:123
Definition: navBot.h:36
Definition: navBot.h:16
Definition: navBot.h:27
CollisionAvoidanceConfiguration()
Sets defaults.
Definition: navBot.h:65
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
double myPropagationBoxExtent
Determines the size of the box used for path planning.
Definition: navBot.h:56
#define DT_DLL_vrfNavigation
This file is used to determine how to build.
Definition: vrfNavigationDefines.h:26
virtual ~DtNavBot()
Definition: navBot.h:97
PathStatus
Definition: navBot.h:121
bool myEnableStop
Definition: navBot.h:80
Calculating a transition point.
Definition: navBot.h:130
DtNavTagAndLocation()
Definition: navBot.h:22
DtNavTagAndLocation(const DtNavTag &t, const DtVector &l)
Definition: navBot.h:21
NavigationMethod myNavigationMethod
Definition: navBot.h:46
bool myUseAbstractGraph
Indicates whether the abstract graph should be used for planning.
Definition: navBot.h:49
NavigationMethod
Definition: navBot.h:30
Arrived at edge of area.
Definition: navBot.h:129

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)