VR-Forces 5.0.1 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 setPathCostEvalFunction(DtNavBot::DtNavBotPathLocationEvalFcn fcn, void* usr);
106 
109  virtual void clearPathCostEvalFunction();
110 
111  virtual DtVector transitionPoint() const { return myTransitionPoint; };
112 
113  virtual bool usingTransitionPoint() const;
114 
115  virtual bool nextTransitionPoint(DtVector& tPoint);
116 
118  virtual bool findingTransitionPoint() const;
119 
124  virtual std::vector<DtVector> searchInArea(double radius, double postSpacing, DtNavArea::DtPointOfInterestEvaluatorFcn = 0,
125  void* usrData = 0, int navTag = -1);
126  virtual std::vector<DtVector> searchInArea(const DtVector& startPoint,
127  double radius, double postSpacing, DtNavArea::DtPointOfInterestEvaluatorFcn = 0,
128  void* usrData = 0, int navTag = -1);
129 
132  virtual DtNavAreaQuery::Ptr findBestPathTo(const std::vector<DtVector>& localPositions,
134  DtNavArea::DtPathCalculatedEvaluatorFcn = 0, void* usrData = 0);
135 
138  virtual DtNavAreaQuery::Ptr findPathToLocation(const DtVector& start, const DtVector& destination,
139  bool useAbstractGraphs, const DtVector& locationToAvoid = DtVector(), double avoidanceRadius = 0);
140 
143  virtual bool findFarthestPositionAlongHeading(const DtVector& start,
144  double heading, double maxDistance, DtVector& result, bool& reachedMaxDist) const;
145 
147  virtual void cancelQuery(DtNavAreaQuery::Ptr);
148 
151  virtual bool findFarthestPositionAlongHeading(double heading, double maxDistance,
152  DtVector& result, bool& reachedMaxDist) const;
153 
155  virtual DtNavTag navTagAtPosition(const DtVector& localPos) const;
156 
158  virtual DtNavTag upcomingNavTagOnPath() const;
159 
161  virtual void upcomingNavTagsOnPath(double distance, DtNavTagAndLocationList& navTags) const;
162 
164  virtual void setNavigationMethod(DtNavBot::NavigationMethod navMethod);
165 
167  virtual void resetNavigationMethod();
168 
170  virtual DtNavBot::NavigationMethod navigationMethod() const;
171 
174  virtual DtVector performMovement(double dt);
175 
178  virtual DtVector groundClamp(const DtVector& localPos, DtVector& normal);
179 
181  bool findValidPositionNearby(const DtVector& localStart, double radius, DtVector& result);
182 
185  virtual DtNavBot* navBot();
186 
187 protected:
188 
190  virtual void changingNavArea(DtNavArea* newNavArea);
191 
193  virtual void processSetLocationComplete();
194 
195  virtual DtNavAreaQuery::Ptr findTransitionPoint(DtNavArea* navArea, const DtVector& localStart, const DtVector& localDest);
196  virtual DtNavAreaQuery::Ptr findBestExitPoint(DtNavArea* navArea, const DtVector& localStart, const DtVector& localDest);
197  virtual DtNavAreaQuery::Ptr findCoverPoint(DtNavArea* navArea, const DtVector& localStart,
198  const DtVector& localCoverFrom, double coverFromRadius, double distanceFromThreat);
199  virtual bool findInsidePositionFromOutsidePosition(DtNavArea* navArea,
200  const DtVector& localStart, const DtVector& localDest, DtVector& result, int& halfEdgeType);
201 
204  virtual DtVector adjustDestination(const DtVector& localDest);
205 
208  virtual DtVector localOrParentPos(const DtVector& localPos);
210  virtual DtVector objectLocationLocalOrParent() const;
211 
215  virtual bool botShouldBeActive();
216 
227  virtual void setCollisionAvoidParams(DtNavBot::CollisionAvoidanceConfiguration& collAvoidConfig);
228 
230  virtual void findTransitionPointStartingFrom(const DtVector& startingPoint,
231  const DtVector& to);
232 
233  virtual void removeDebugTransitionPoints();
234 
240  virtual void setNavigationConfigParams(DtNavBot::NavigationConfiguration& navConfig);
241 
242 protected:
246 
248 
252 
254  boost::shared_ptr<DtTransitionPointFinder> myPendingPointFinder;
255 
256  std::list<DtNavAreaQuery::WeakPtr> myActiveQueries;
257 
258  boost::shared_ptr<DtCoverPointFinder> myPendingCoverPointFinder;
259 
262 
264 
267 
268  std::vector<DtLocalObject*> myDebugTransitionPoints;
269 
272 
278 
280  boost::signals2::scoped_connection myLocationCompleteConnection;
281 
283 };
DtNavAreaQuery::Ptr myPendingQuery
Definition: activeBotNavInterface.h:253
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:38
void(* DtSearchAreaPointCostModifierEvaluatorFcn)(const DtVector &localPoint, float *currentCost, void *userData)
Definition: navArea.h:235
DtNavBot::DtNavBotPathLocationEvalFcn myPathCostEvalFcn
Definition: activeBotNavInterface.h:265
boost::signals2::scoped_connection myLocationCompleteConnection
Definition: activeBotNavInterface.h:280
This is the DtVrfObjectNavInterface subclass for objects which are actively querying the navigation s...
Definition: activeBotNavInterface.h:27
DtVector myTransitionPoint
Definition: activeBotNavInterface.h:247
DtNavBot * myNavBot
Definition: activeBotNavInterface.h:244
boost::shared_ptr< DtCoverPointFinder > myPendingCoverPointFinder
Definition: activeBotNavInterface.h:258
boost::shared_ptr< DtTransitionPointFinder > myPendingPointFinder
Definition: activeBotNavInterface.h:254
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:273
DtTime myInitialSimTime
Definition: activeBotNavInterface.h:277
int myControllerPriority
Definition: activeBotNavInterface.h:260
bool mySetDestinationWaitingForNav
Definition: activeBotNavInterface.h:274
DtString myController
Definition: activeBotNavInterface.h:261
bool myFindingDestNavAreaTransitionPoint
Definition: activeBotNavInterface.h:251
#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:276
DtVector myDestNavAreaTransitionPoint
Definition: activeBotNavInterface.h:250
std::vector< DtLocalObject * > myDebugTransitionPoints
Definition: activeBotNavInterface.h:268
DtString myStatusString
Definition: activeBotNavInterface.h:263
virtual DtVector transitionPoint() const
Definition: activeBotNavInterface.h:111
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:275
Definition: navBot.h:40
DtNavArea * navArea()
Definition: activeBotNavInterface.h:58
DtString myProfile
Definition: activeBotNavInterface.h:243
bool myFailedToFindTransitionPoint
Definition: activeBotNavInterface.h:270
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: activeBotNavInterface.h:282
virtual void postObjectInit()
Perform additional initialization after the object has been initialized. Default behavior is to do no...
Definition: vrfObjectNavInterface.h:64
Definition: navBot.h:31
bool myFailedToFindCoverPoint
Definition: activeBotNavInterface.h:271
DtVrfObjectNavInterface & operator=(const DtVrfObjectNavInterface &orig)
Not Implemented.
DtNavArea * myDestNavArea
Definition: activeBotNavInterface.h:249
std::list< DtNavAreaQuery::WeakPtr > myActiveQueries
Definition: activeBotNavInterface.h:256
DtNavArea * myNavArea
Definition: activeBotNavInterface.h:245
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:266
DtNavBot::NavigationMethod myDefaultNavigationMethod
Definition: activeBotNavInterface.h:279
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)