VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 
27 {
28 public:
30  {
31  NavigationMethodShortcut = 0,
32  NavigationMethodSpline = 1
33  };
34 
36  {
38  : myNavigationMethod(NavigationMethodShortcut)
39  , myUseAbstractGraph(true)
40  , myMinAbstractGraphReplanDistance(100.)
41  , myPropagationBoxExtent(200.)
42  {}
43 
55  };
56 
58  {
61  : myEnableAvoidance(true)
62  , myEnableStop(true)
63  , myEnableSlowDown(true)
64  , myEnablePushThrough(false)
65  , myEnableNavigation(true)
66  , myCollisionLookaheadTime(15.)
67  , myCollisionDetectionRadius(15.)
68  , myAngleEvalSpan(120)
69  , myNumAngleSamples(30)
70  , mySafetyDistance((float)0.1)
71  , myCollisionAvoidanceInfluence((float)0.8)
72  {}
73 
85  };
86 
87  typedef DtNavBot* (*DtNavBotCreatorFcn)();
88 
89  static DtNavBot* create();
90  static void setNavBotCreatorFcn(DtNavBotCreatorFcn fcn);
91 
92  virtual ~DtNavBot() {};
93 
94  virtual void init(DtNavArea* world, const DtString& profile, double radius, double height,
95  NavigationConfiguration navConfig = NavigationConfiguration(),
96  CollisionAvoidanceConfiguration collAvoidConfig = CollisionAvoidanceConfiguration()) = 0;
97 
98  virtual void setPosition(const DtVector& localPos) = 0;
99  virtual void botUpdate(const DtVector& localPos, double dT) = 0;
100 
101  virtual void setDestination(const DtVector& localPos, bool forceOutsideArea = false) = 0;
102  virtual void setDesiredSpeed(double speed) = 0;
103  virtual void clearFollowedPath() = 0;
104  virtual void clearDestination() = 0;
105 
106  virtual void moveAlongPath(const std::vector<DtVector>&) = 0;
107 
108  virtual DtVector getOutputVelocity() = 0;
109 
110  typedef bool (*DtNavBotPathLocationEvalFcn)(const DtNavTag& navTag, float* costMultiplier, void* userData);
111 
112  virtual void setPathEvalFcn(DtNavBotPathLocationEvalFcn fcn, void* user) = 0;
113 
115  {
122  PathStatusFindingTransitionPoint
123  };
124 
125  virtual PathStatus pathStatus(double atDistance) = 0;
127  virtual DtString pathStatusString() = 0;
128 
129  virtual bool hasArrived(double arrivalDistance) = 0;
130 
131  virtual bool currentPath(std::vector<DtVector>& path) = 0;
132  virtual bool abstractPath(std::vector<DtVector>& path) = 0;
133 
134  virtual unsigned currentAbstractPathIndex() = 0;
135 
137  virtual DtNavTag navTagAtPosition(const DtVector& localPos) const = 0;
138 
140  virtual DtNavTag upcomingNavTagOnPath() const = 0;
141 
143  virtual void upcomingNavTagsOnPath(double distance, DtNavTagAndLocationList& navTags) const = 0;
144 
145 protected:
146  static DtNavBotCreatorFcn theNavBotCreatorFcn;
147 };

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)