VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
activeBotNavInterface.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
14 #include "vrfobjcore/simObject.h"
15 #include "vrfNavigation/navArea.h"
17 #include "vrfNavigation/navBot.h"
19 
20 #include <matrix/vlVector.h>
21 
22 class DtNavTag;
23 
28 {
29 private:
36 
37 public:
38  static DtVrfObjectNavInterface* create(DtLocalObject* vrfObject);
39 
40 protected:
44  virtual bool init();
45 
46 public:
47 
48  virtual void postObjectInit();
49 
50  virtual void firstTick();
51  virtual void tick();
52  virtual ~DtActiveBotNavInterface();
53 
57  virtual bool ableToNavigate() const;
58  DtNavArea* navArea() { return myNavArea; }
59  const DtNavArea* navArea() const { return myNavArea; }
60 
61  virtual const DtString& navProfile() const;
62  virtual void setNavProfile(const DtString& profile);
63 
64  virtual bool requestControl(int priority, const DtString& controller);
65  virtual bool hasControl(int priority);
66  virtual void releaseControl(int priority);
67 
72  virtual void setDestination(const DtVector& localDest);
73 
74  virtual DtVector destination() const;
75 
76  virtual void resetDestination();
77 
79  virtual void setPositionInvalid();
80 
81  virtual void setDesiredSpeed(double speed);
82 
83  virtual DtNavBot::PathStatus pathStatus(double atDistance);
85  virtual DtString pathStatusString();
86 
89  virtual double getOutputSpeed();
92  virtual double getOutputHeading();
93 
94  virtual bool currentPath(std::vector<DtVector>& path);
95  virtual bool abstractPath(std::vector<DtVector>& path);
96 
97  virtual bool currentPathEdge(DtVector& edgeStart, DtVector& edgeEnd);
98 
99  virtual void getNavPathAsRw(DtRwBinaryData&);
100 
101  virtual unsigned currentAbstractPathIndex();
102 
105  virtual void setUseAbstractGraph(bool yesNo);
106 
108  virtual void resetUseAbstractGraph();
109 
111  virtual bool usingAbstractGraph() const;
112 
115  virtual void setPathCostEvalFunction(DtNavBot::DtNavBotPathLocationEvalFcn fcn, void* usr);
116 
119  virtual void clearPathCostEvalFunction();
120 
121  virtual DtVector transitionPoint() const { return myTransitionPoint; };
122 
123  virtual bool usingTransitionPoint() const;
124 
125  virtual bool nextTransitionPoint(DtVector& tPoint);
126 
128  virtual bool findingTransitionPoint() const;
129 
134  virtual std::vector<DtVector> searchInArea(double radius, double postSpacing, DtNavArea::DtPointOfInterestEvaluatorFcn = 0,
135  void* usrData = 0, int navTag = -1);
136  virtual std::vector<DtVector> searchInArea(const DtVector& startPoint,
137  double radius, double postSpacing, DtNavArea::DtPointOfInterestEvaluatorFcn = 0,
138  void* usrData = 0, int navTag = -1);
139 
142  virtual DtNavAreaQuery::Ptr findBestPathTo(const std::vector<DtVector>& localPositions,
144  DtNavArea::DtPathCalculatedEvaluatorFcn = 0, void* usrData = 0);
145 
148  virtual DtNavAreaQuery::Ptr findPathToLocation(const DtVector& start, const DtVector& destination,
149  bool useAbstractGraphs, const DtVector& locationToAvoid = DtVector(), double avoidanceRadius = 0);
150 
153  virtual bool findFarthestPositionAlongHeading(const DtVector& start,
154  double heading, double maxDistance, DtVector& result, bool& reachedMaxDist) const;
155 
157  virtual void cancelQuery(DtNavAreaQuery::Ptr);
158 
161  virtual bool findFarthestPositionAlongHeading(double heading, double maxDistance,
162  DtVector& result, bool& reachedMaxDist) const;
163 
165  virtual DtNavTag navTagAtPosition(const DtVector& localPos) const;
166 
168  virtual DtNavTag upcomingNavTagOnPath() const;
169 
171  virtual void upcomingNavTagsOnPath(double distance, DtNavTagAndLocationList& navTags) const;
172 
174  virtual void setNavigationMethod(DtNavBot::NavigationMethod navMethod);
175 
177  virtual void resetNavigationMethod();
178 
180  virtual DtNavBot::NavigationMethod navigationMethod() const;
181 
184  virtual DtVector performMovement(double dt);
185 
188  virtual DtVector groundClamp(const DtVector& localPos, DtVector& normal);
189 
191  bool findValidPositionNearby(const DtVector& localStart, double radius, DtVector& result);
192 
195  virtual DtNavBot* navBot();
196 
199  virtual bool changeAreaIfOverlapping(const DtVector& dest);
200 
201 protected:
202 
204  virtual void changingNavArea(DtNavArea* newNavArea);
205 
207  virtual void processSetLocationComplete();
208 
209  virtual DtNavAreaQuery::Ptr findTransitionPoint(DtNavArea* navArea, const DtVector& localStart, const DtVector& localDest);
210  virtual DtNavAreaQuery::Ptr findBestExitPoint(DtNavArea* navArea, const DtVector& localStart, const DtVector& localDest);
211  virtual DtNavAreaQuery::Ptr findCoverPoint(DtNavArea* navArea, const DtVector& localStart,
212  const DtVector& localCoverFrom, double coverFromRadius, double distanceFromThreat);
213  virtual bool findInsidePositionFromOutsidePosition(DtNavArea* navArea,
214  const DtVector& localStart, const DtVector& localDest, DtVector& result, int& halfEdgeType);
215 
218  virtual DtVector adjustDestination(const DtVector& localDest);
219 
222  virtual DtVector localOrParentPos(const DtVector& localPos);
224  virtual DtVector objectLocationLocalOrParent() const;
225 
229  virtual bool botShouldBeActive();
230 
241  virtual void setCollisionAvoidParams(DtNavBot::CollisionAvoidanceConfiguration& collAvoidConfig);
242 
244  virtual void findTransitionPointStartingFrom(const DtVector& startingPoint,
245  const DtVector& to);
246 
247  virtual void removeDebugTransitionPoints();
248 
254  virtual void setNavigationConfigParams(DtNavBot::NavigationConfiguration& navConfig);
255 
256 protected:
260 
262 
266 
268  boost::shared_ptr<DtTransitionPointFinder> myPendingPointFinder;
269 
270  std::list<DtNavAreaQuery::WeakPtr> myActiveQueries;
271 
272  boost::shared_ptr<DtCoverPointFinder> myPendingCoverPointFinder;
273 
276 
278 
281 
282  std::vector<DtLocalObject*> myDebugTransitionPoints;
283 
286 
292 
294  boost::signals2::scoped_connection myLocationCompleteConnection;
295 
297 };
DtNavAreaQuery::Ptr myPendingQuery
Definition: activeBotNavInterface.h:267
const DtNavArea * navArea() const
Definition: activeBotNavInterface.h:59
A nav interface is a software component of an object that maintains the object&#39;s presence in the navi...
Definition: vrfObjectNavInterface.h:39
void(* DtSearchAreaPointCostModifierEvaluatorFcn)(const DtVector &localPoint, float *currentCost, void *userData)
Definition: navArea.h:235
DtNavBot::DtNavBotPathLocationEvalFcn myPathCostEvalFcn
Definition: activeBotNavInterface.h:279
boost::signals2::scoped_connection myLocationCompleteConnection
Definition: activeBotNavInterface.h:294
This is the DtVrfObjectNavInterface subclass for objects which are actively querying the navigation s...
Definition: activeBotNavInterface.h:27
DtVector myTransitionPoint
Definition: activeBotNavInterface.h:261
DtNavBot * myNavBot
Definition: activeBotNavInterface.h:258
boost::shared_ptr< DtCoverPointFinder > myPendingCoverPointFinder
Definition: activeBotNavInterface.h:272
boost::shared_ptr< DtTransitionPointFinder > myPendingPointFinder
Definition: activeBotNavInterface.h:268
DtOnPathToGraphVertexComputedResult(* DtPathCalculatedEvaluatorFcn)(const DtVector &localPoint, double pathCost, void *userData)
Definition: navArea.h:236
VR-Forces wrapper for Gameware NavTag. Note: This class keeps only a pointer to the data...
Definition: navDataTag.h:87
DtOnGraphVertexVisitedResult(* DtPointOfInterestEvaluatorFcn)(const DtVector &localPoint, void *userData)
Definition: navArea.h:233
This is a rw class to save out a block of generic binary data.
Definition: rwBinaryData.h:18
bool myWaitingForInitialNav
Definition: activeBotNavInterface.h:287
DtTime myInitialSimTime
Definition: activeBotNavInterface.h:291
int myControllerPriority
Definition: activeBotNavInterface.h:274
bool mySetDestinationWaitingForNav
Definition: activeBotNavInterface.h:288
DtString myController
Definition: activeBotNavInterface.h:275
bool myFindingDestNavAreaTransitionPoint
Definition: activeBotNavInterface.h:265
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
This class contains all the data and logic for navigation within a specific area. Nav Data may be loa...
Definition: navArea.h:206
virtual void firstTick()
virtual bool init()
Virtual init, called from the create() method.
DtVector myDestinationWaitingForNav
Definition: activeBotNavInterface.h:290
DtVector myDestNavAreaTransitionPoint
Definition: activeBotNavInterface.h:264
std::vector< DtLocalObject * > myDebugTransitionPoints
Definition: activeBotNavInterface.h:282
DtString myStatusString
Definition: activeBotNavInterface.h:277
virtual DtVector transitionPoint() const
Definition: activeBotNavInterface.h:121
bool(* DtNavBotPathLocationEvalFcn)(const DtNavTag &navTag, float slope, float elevationChange, float *costMultiplier, void *userData)
Definition: navBot.h:129
boost::shared_ptr< DtNavAreaQuery > Ptr
Definition: navArea.h:60
bool myNavigationIsEnabled
Definition: activeBotNavInterface.h:289
Definition: navBot.h:40
DtNavArea * navArea()
Definition: activeBotNavInterface.h:58
DtString myProfile
Definition: activeBotNavInterface.h:257
bool myFailedToFindTransitionPoint
Definition: activeBotNavInterface.h:284
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: activeBotNavInterface.h:296
virtual void postObjectInit()
Perform additional initialization after the object has been initialized. Default behavior is to do no...
Definition: vrfObjectNavInterface.h:67
Definition: navBot.h:31
bool myFailedToFindCoverPoint
Definition: activeBotNavInterface.h:285
DtVrfObjectNavInterface & operator=(const DtVrfObjectNavInterface &orig)
Not Implemented.
DtNavArea * myDestNavArea
Definition: activeBotNavInterface.h:263
std::list< DtNavAreaQuery::WeakPtr > myActiveQueries
Definition: activeBotNavInterface.h:270
DtNavArea * myNavArea
Definition: activeBotNavInterface.h:259
PathStatus
Definition: navBot.h:133
virtual bool ableToNavigate() const
Generic call. Basic nav interfaces are not able to navigate.
NavigationMethod
Definition: navBot.h:34
virtual void changingNavArea(DtNavArea *newNavArea)
Called when about to change to a new navArea.
void * myPathCostEvalFcnUsrData
Definition: activeBotNavInterface.h:280
char * dest
Definition: lz4.h:440
DtNavBot::NavigationMethod myDefaultNavigationMethod
Definition: activeBotNavInterface.h:293
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)