VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtActiveBotNavInterface Class Reference

This is the DtVrfObjectNavInterface subclass for objects which are actively querying the navigation system. They will have a DtNavBot instantiated if they are within a navigation area.

Inheritance diagram for DtActiveBotNavInterface:
Inheritance graph
[legend]

Public Member Functions

virtual void postObjectInit ()
 
virtual void firstTick ()
 
virtual void tick ()
 
virtual ~DtActiveBotNavInterface ()
 
virtual bool ableToNavigate () const
 
DtNavAreanavArea ()
 
const DtNavAreanavArea () const
 
virtual const DtStringnavProfile () const
 
virtual void setNavProfile (const DtString &profile)
 
virtual bool requestControl (int priority, const DtString &controller)
 
virtual bool hasControl (int priority)
 
virtual void releaseControl (int priority)
 
virtual void setDestination (const DtVector &localDest)
 
virtual DtVector destination () const
 
virtual void resetDestination ()
 
virtual void setPositionInvalid ()
 
virtual void setDesiredSpeed (double speed)
 
virtual DtNavBot::PathStatus pathStatus (double atDistance)
 
virtual DtString pathStatusString ()
 
virtual double getOutputSpeed ()
 
virtual double getOutputHeading ()
 
virtual bool currentPath (std::vector< DtVector > &path)
 
virtual bool abstractPath (std::vector< DtVector > &path)
 
virtual bool currentPathEdge (DtVector &edgeStart, DtVector &edgeEnd)
 
virtual void getNavPathAsRw (DtRwBinaryData &)
 
virtual unsigned currentAbstractPathIndex ()
 
virtual void setUseAbstractGraph (bool yesNo)
 
virtual void resetUseAbstractGraph ()
 
virtual bool usingAbstractGraph () const
 
virtual void setPathCostEvalFunction (DtNavBot::DtNavBotPathLocationEvalFcn fcn, void *usr)
 
virtual void clearPathCostEvalFunction ()
 
virtual DtVector transitionPoint () const
 
virtual bool usingTransitionPoint () const
 
virtual bool nextTransitionPoint (DtVector &tPoint)
 
virtual bool findingTransitionPoint () const
 
virtual std::vector< DtVectorsearchInArea (double radius, double postSpacing, DtNavArea::DtPointOfInterestEvaluatorFcn=0, void *usrData=0, int navTag=-1)
 
virtual std::vector< DtVectorsearchInArea (const DtVector &startPoint, double radius, double postSpacing, DtNavArea::DtPointOfInterestEvaluatorFcn=0, void *usrData=0, int navTag=-1)
 
virtual DtNavAreaQuery::Ptr findBestPathTo (const std::vector< DtVector > &localPositions, DtNavArea::DtSearchAreaPointCostModifierEvaluatorFcn=0, DtNavArea::DtPointOfInterestEvaluatorFcn=0, DtNavArea::DtPathCalculatedEvaluatorFcn=0, void *usrData=0)
 
virtual DtNavAreaQuery::Ptr findPathToLocation (const DtVector &start, const DtVector &destination, bool useAbstractGraphs, const DtVector &locationToAvoid=DtVector(), double avoidanceRadius=0)
 
virtual bool findFarthestPositionAlongHeading (const DtVector &start, double heading, double maxDistance, DtVector &result, bool &reachedMaxDist) const
 
virtual void cancelQuery (DtNavAreaQuery::Ptr)
 
virtual bool findFarthestPositionAlongHeading (double heading, double maxDistance, DtVector &result, bool &reachedMaxDist) const
 
virtual DtNavTag navTagAtPosition (const DtVector &localPos) const
 
virtual DtNavTag upcomingNavTagOnPath () const
 
virtual void upcomingNavTagsOnPath (double distance, DtNavTagAndLocationList &navTags) const
 
virtual void setNavigationMethod (DtNavBot::NavigationMethod navMethod)
 
virtual void resetNavigationMethod ()
 
virtual DtNavBot::NavigationMethod navigationMethod () const
 
virtual DtVector performMovement (double dt)
 
virtual DtVector groundClamp (const DtVector &localPos, DtVector &normal)
 
bool findValidPositionNearby (const DtVector &localStart, double radius, DtVector &result)
 
virtual DtNavBotnavBot ()
 
virtual bool changeAreaIfOverlapping (const DtVector &dest)
 
- Public Member Functions inherited from DtVrfObjectNavInterface
virtual ~DtVrfObjectNavInterface ()=0
 
virtual void addNavAreaChangedCallback (DtNoArgumentCallbackList::DtCallbackFunctionType callback, void *usr) const
 
virtual void removeNavAreaChangedCallback (DtNoArgumentCallbackList::DtCallbackFunctionType callback, void *usr) const
 
virtual void invokeNavAreaChangedCallbacks ()
 
virtual void setWaitingForLoad (bool isLoading)
 
virtual bool isWaitingForLoad () const
 

Static Public Member Functions

static DtVrfObjectNavInterfacecreate (DtLocalObject *vrfObject)
 

Protected Member Functions

 DtActiveBotNavInterface (DtLocalObject *vrfObject)
 
virtual bool init ()
 
virtual void changingNavArea (DtNavArea *newNavArea)
 
virtual void processSetLocationComplete ()
 
virtual DtNavAreaQuery::Ptr findTransitionPoint (DtNavArea *navArea, const DtVector &localStart, const DtVector &localDest)
 
virtual DtNavAreaQuery::Ptr findBestExitPoint (DtNavArea *navArea, const DtVector &localStart, const DtVector &localDest)
 
virtual DtNavAreaQuery::Ptr findCoverPoint (DtNavArea *navArea, const DtVector &localStart, const DtVector &localCoverFrom, double coverFromRadius, double distanceFromThreat)
 
virtual bool findInsidePositionFromOutsidePosition (DtNavArea *navArea, const DtVector &localStart, const DtVector &localDest, DtVector &result, int &halfEdgeType)
 
virtual DtVector adjustDestination (const DtVector &localDest)
 
virtual DtVector localOrParentPos (const DtVector &localPos)
 
virtual DtVector objectLocationLocalOrParent () const
 
virtual bool botShouldBeActive ()
 
virtual void setCollisionAvoidParams (DtNavBot::CollisionAvoidanceConfiguration &collAvoidConfig)
 
virtual void findTransitionPointStartingFrom (const DtVector &startingPoint, const DtVector &to)
 
virtual void removeDebugTransitionPoints ()
 
virtual void setNavigationConfigParams (DtNavBot::NavigationConfiguration &navConfig)
 
- Protected Member Functions inherited from DtVrfObjectNavInterface
 DtVrfObjectNavInterface (DtLocalObject *vrfObject)
 
 DtVrfObjectNavInterface (DtSimObjectReference vrfObject)
 
virtual bool isCollidableWhenDestroyed () const
 

Protected Attributes

DtString myProfile
 
DtNavBotmyNavBot
 
DtNavAreamyNavArea
 
DtVector myTransitionPoint
 
DtNavAreamyDestNavArea
 
DtVector myDestNavAreaTransitionPoint
 
bool myFindingDestNavAreaTransitionPoint
 
DtNavAreaQuery::Ptr myPendingQuery
 
boost::shared_ptr
< DtTransitionPointFinder
myPendingPointFinder
 
std::list
< DtNavAreaQuery::WeakPtr
myActiveQueries
 
boost::shared_ptr
< DtCoverPointFinder
myPendingCoverPointFinder
 
int myControllerPriority
 
DtString myController
 
DtString myStatusString
 
DtNavBot::DtNavBotPathLocationEvalFcn myPathCostEvalFcn
 
void * myPathCostEvalFcnUsrData
 
std::vector< DtLocalObject * > myDebugTransitionPoints
 
bool myFailedToFindTransitionPoint
 
bool myFailedToFindCoverPoint
 
bool myWaitingForInitialNav
 
bool mySetDestinationWaitingForNav
 
bool myNavigationIsEnabled
 
DtVector myDestinationWaitingForNav
 
DtTime myInitialSimTime
 
DtNavBot::NavigationMethod myDefaultNavigationMethod
 
boost::signals2::scoped_connection myLocationCompleteConnection
 
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
 
- Protected Attributes inherited from DtVrfObjectNavInterface
DtLocalObjectmyVrfObject
 
DtSimObjectReference mySimObjectReference
 
DtSimulationServicesmySimulationServices
 
DtNavAreamyCurrentNavArea
 
bool myFirstTick
 
bool myIsWaitingForNavLoad
 
DtNoArgumentCallbackList myChangedNavAreaCallbackList
 

Private Member Functions

 DtActiveBotNavInterface ()
 
 DtActiveBotNavInterface (const DtActiveBotNavInterface &orig)
 
DtActiveBotNavInterfaceoperator= (const DtActiveBotNavInterface &orig)
 

Constructor & Destructor Documentation

DtActiveBotNavInterface::DtActiveBotNavInterface ( )
private

Not Implemented.

DtActiveBotNavInterface::DtActiveBotNavInterface ( const DtActiveBotNavInterface orig)
private

Not Implemented.

DtActiveBotNavInterface::DtActiveBotNavInterface ( DtLocalObject vrfObject)
protected

Use the create() method instead of calling the constructor.

virtual DtActiveBotNavInterface::~DtActiveBotNavInterface ( )
virtual

Member Function Documentation

DtActiveBotNavInterface& DtActiveBotNavInterface::operator= ( const DtActiveBotNavInterface orig)
private

Not Implemented.

static DtVrfObjectNavInterface* DtActiveBotNavInterface::create ( DtLocalObject vrfObject)
static
virtual bool DtActiveBotNavInterface::init ( )
protectedvirtual

Virtual init, called from the create() method.

Reimplemented from DtVrfObjectNavInterface.

virtual void DtActiveBotNavInterface::postObjectInit ( )
virtual

Perform additional initialization after the object has been initialized. Default behavior is to do nothing, must be implemented in subclass.

Reimplemented from DtVrfObjectNavInterface.

virtual void DtActiveBotNavInterface::firstTick ( )
virtual

Reimplemented from DtVrfObjectNavInterface.

virtual void DtActiveBotNavInterface::tick ( )
virtual

Reimplemented from DtVrfObjectNavInterface.

virtual bool DtActiveBotNavInterface::ableToNavigate ( ) const
virtual

Indicates whether or not this navInterface is currently able to provide navigation services for the entity. This will be true when the entity is in a navigation area and in a valid location for navigation.

Reimplemented from DtVrfObjectNavInterface.

DtNavArea* DtActiveBotNavInterface::navArea ( )
inline
const DtNavArea* DtActiveBotNavInterface::navArea ( ) const
inline
virtual const DtString& DtActiveBotNavInterface::navProfile ( ) const
virtual
virtual void DtActiveBotNavInterface::setNavProfile ( const DtString profile)
virtual
virtual bool DtActiveBotNavInterface::requestControl ( int  priority,
const DtString controller 
)
virtual
virtual bool DtActiveBotNavInterface::hasControl ( int  priority)
virtual
virtual void DtActiveBotNavInterface::releaseControl ( int  priority)
virtual
virtual void DtActiveBotNavInterface::setDestination ( const DtVector localDest)
virtual

Sets the destination into the navBot if it is there. If there is no navBot, but the destination is in a navArea, finds the best point to enter the area and sets it to transitionPoint.

virtual DtVector DtActiveBotNavInterface::destination ( ) const
virtual
virtual void DtActiveBotNavInterface::resetDestination ( )
virtual
virtual void DtActiveBotNavInterface::setPositionInvalid ( )
virtual

Can be used to indicate that the bot's current position is invalid.

virtual void DtActiveBotNavInterface::setDesiredSpeed ( double  speed)
virtual
virtual DtNavBot::PathStatus DtActiveBotNavInterface::pathStatus ( double  atDistance)
virtual
virtual DtString DtActiveBotNavInterface::pathStatusString ( )
virtual
Returns
A text string relating to the current path status.
virtual double DtActiveBotNavInterface::getOutputSpeed ( )
virtual
Returns
The desired speed generated by the navigation system to move the entity. This is relative to the entity's embarkation parent, if embarked.
virtual double DtActiveBotNavInterface::getOutputHeading ( )
virtual
Returns
The desired heading generated by the navigation system to move the entity. This is a heading from north, even if entity is embarked.
virtual bool DtActiveBotNavInterface::currentPath ( std::vector< DtVector > &  path)
virtual
virtual bool DtActiveBotNavInterface::abstractPath ( std::vector< DtVector > &  path)
virtual
virtual bool DtActiveBotNavInterface::currentPathEdge ( DtVector edgeStart,
DtVector edgeEnd 
)
virtual
virtual void DtActiveBotNavInterface::getNavPathAsRw ( DtRwBinaryData )
virtual
virtual unsigned DtActiveBotNavInterface::currentAbstractPathIndex ( )
virtual
virtual void DtActiveBotNavInterface::setUseAbstractGraph ( bool  yesNo)
virtual

Can be used to enable or disable abstract graph usage. Takes effect the next time the destination is set.

virtual void DtActiveBotNavInterface::resetUseAbstractGraph ( )
virtual

Resets abstract graph usage to configured settings, undoing any settings from setUseAbstractGraph.

virtual bool DtActiveBotNavInterface::usingAbstractGraph ( ) const
virtual

Returns whether the abstract graph is currently in use.

virtual void DtActiveBotNavInterface::setPathCostEvalFunction ( DtNavBot::DtNavBotPathLocationEvalFcn  fcn,
void *  usr 
)
virtual

Sets a function that will be called frequently during path finding and path following to evaluate the cost of crossing various section of the navigation data.

virtual void DtActiveBotNavInterface::clearPathCostEvalFunction ( )
virtual

Clears the current path cost eval function and cancels all current queries, which will be using the old, invalid function.

virtual DtVector DtActiveBotNavInterface::transitionPoint ( ) const
inlinevirtual
virtual bool DtActiveBotNavInterface::usingTransitionPoint ( ) const
virtual
virtual bool DtActiveBotNavInterface::nextTransitionPoint ( DtVector tPoint)
virtual
virtual bool DtActiveBotNavInterface::findingTransitionPoint ( ) const
virtual

Returns true if in the process of looking for a transition point.

virtual std::vector<DtVector> DtActiveBotNavInterface::searchInArea ( double  radius,
double  postSpacing,
DtNavArea::DtPointOfInterestEvaluatorFcn  = 0,
void *  usrData = 0,
int  navTag = -1 
)
virtual

Returns a list of points that have been judged to be usable within the given area and post spacing. When using the evaluator function return OnGraphVertexVisited_VertexIsTheBestSoFar_GoOn to add that point to the potential list points to use. Return OnGraphVertexVisited_StopOnThisVertex to only use this vertex and OnGraphVertexVisited_IgnoreVertex_StopWithBestSoFar to not add this point but to stop the search. Uses current location of entity.

virtual std::vector<DtVector> DtActiveBotNavInterface::searchInArea ( const DtVector startPoint,
double  radius,
double  postSpacing,
DtNavArea::DtPointOfInterestEvaluatorFcn  = 0,
void *  usrData = 0,
int  navTag = -1 
)
virtual
virtual DtNavAreaQuery::Ptr DtActiveBotNavInterface::findBestPathTo ( const std::vector< DtVector > &  localPositions,
DtNavArea::DtSearchAreaPointCostModifierEvaluatorFcn  = 0,
DtNavArea::DtPointOfInterestEvaluatorFcn  = 0,
DtNavArea::DtPathCalculatedEvaluatorFcn  = 0,
void *  usrData = 0 
)
virtual

Starts the process of finding the best path to any of the given destination points. Check the pathStatus() to see when finished.

virtual DtNavAreaQuery::Ptr DtActiveBotNavInterface::findPathToLocation ( const DtVector start,
const DtVector destination,
bool  useAbstractGraphs,
const DtVector locationToAvoid = DtVector(),
double  avoidanceRadius = 0 
)
virtual

Returns a query to find a path from the given starting location to the given destination position. Optionally a location to avoid can be given. Will use the profile and current navigation settings of the bot.

virtual bool DtActiveBotNavInterface::findFarthestPositionAlongHeading ( const DtVector start,
double  heading,
double  maxDistance,
DtVector result,
bool reachedMaxDist 
) const
virtual

Finds the farthest point along a given vector that can be traveled without hitting the border of the NavMesh or a non-traversable triangle.

virtual void DtActiveBotNavInterface::cancelQuery ( DtNavAreaQuery::Ptr  )
virtual

Cancels the given query.

virtual bool DtActiveBotNavInterface::findFarthestPositionAlongHeading ( double  heading,
double  maxDistance,
DtVector result,
bool reachedMaxDist 
) const
virtual

Finds the farthest point along a given vector that we can travel without hitting the border of the NavMesh or a non-traversable triangle.

virtual DtNavTag DtActiveBotNavInterface::navTagAtPosition ( const DtVector localPos) const
virtual

Gets the nav tag of the position, if valid.

virtual DtNavTag DtActiveBotNavInterface::upcomingNavTagOnPath ( ) const
virtual

Gets the upcoming nav tag on the path.

virtual void DtActiveBotNavInterface::upcomingNavTagsOnPath ( double  distance,
DtNavTagAndLocationList navTags 
) const
virtual

Gets all nav tags within the specified distance from the current location on the path.

virtual void DtActiveBotNavInterface::setNavigationMethod ( DtNavBot::NavigationMethod  navMethod)
virtual

Updates the navigation method.

virtual void DtActiveBotNavInterface::resetNavigationMethod ( )
virtual

Resets the navigation method to the default setting.

virtual DtNavBot::NavigationMethod DtActiveBotNavInterface::navigationMethod ( ) const
virtual

Gets the current navigation method.

virtual DtVector DtActiveBotNavInterface::performMovement ( double  dt)
virtual

Allows the nav bot to perform movement for the entity. Returns the new entity location after processing movement for the next dt seconds.

virtual DtVector DtActiveBotNavInterface::groundClamp ( const DtVector localPos,
DtVector normal 
)
virtual

Finds a ground clamped position on the nav data near the specified local position. Also outputs the normal of the clamped position.

bool DtActiveBotNavInterface::findValidPositionNearby ( const DtVector localStart,
double  radius,
DtVector result 
)

Finds a valid point near the specific position.

virtual DtNavBot* DtActiveBotNavInterface::navBot ( )
virtual
Returns
The current DtNavBot, if it exists.
Note
Do not hold this between ticks, as it may be deleted, or recreated in a new DtNavArea at any time.
virtual bool DtActiveBotNavInterface::changeAreaIfOverlapping ( const DtVector dest)
virtual

If we are in an overlapping area, and the current area can be made the destination area due to movement, then change it to the destination area. Returns true if area was switched.

virtual void DtActiveBotNavInterface::changingNavArea ( DtNavArea newNavArea)
protectedvirtual

Called when the objects position is in a navArea that it was not on the previous check.

Reimplemented from DtVrfObjectNavInterface.

virtual void DtActiveBotNavInterface::processSetLocationComplete ( )
protectedvirtual

Update nav bot's destination, to trigger a replan.

virtual DtNavAreaQuery::Ptr DtActiveBotNavInterface::findTransitionPoint ( DtNavArea navArea,
const DtVector localStart,
const DtVector localDest 
)
protectedvirtual
virtual DtNavAreaQuery::Ptr DtActiveBotNavInterface::findBestExitPoint ( DtNavArea navArea,
const DtVector localStart,
const DtVector localDest 
)
protectedvirtual
virtual DtNavAreaQuery::Ptr DtActiveBotNavInterface::findCoverPoint ( DtNavArea navArea,
const DtVector localStart,
const DtVector localCoverFrom,
double  coverFromRadius,
double  distanceFromThreat 
)
protectedvirtual
virtual bool DtActiveBotNavInterface::findInsidePositionFromOutsidePosition ( DtNavArea navArea,
const DtVector localStart,
const DtVector localDest,
DtVector result,
int halfEdgeType 
)
protectedvirtual
virtual DtVector DtActiveBotNavInterface::adjustDestination ( const DtVector localDest)
protectedvirtual

Moves the destination to on the nav mesh if possible. May also ground clamp the destination. Assumes the localDest is in the current navArea.

virtual DtVector DtActiveBotNavInterface::localOrParentPos ( const DtVector localPos)
protectedvirtual

If the entity is embarked, converts the provided local position to the parent frame, otherwise returns the same local position provided.

virtual DtVector DtActiveBotNavInterface::objectLocationLocalOrParent ( ) const
protectedvirtual

Returns the local position of the entity, or the parent position if the entity is embarked.

virtual bool DtActiveBotNavInterface::botShouldBeActive ( )
protectedvirtual

Checks any special conditions (other than location) for the activation/deactivation of the bot, such as the entity being destroyed. Returns true if the bot should be active based on these special conditions.

virtual void DtActiveBotNavInterface::setCollisionAvoidParams ( DtNavBot::CollisionAvoidanceConfiguration collAvoidConfig)
protectedvirtual

Sets the collision avoidance configuration from the parameters specified in the platform OPE file. The following parameters are read from the navigation-params section: enable-avoidance (bool) avoidance-enable-stop (bool) avoidance-enable-slow-down (bool) avoidance-enable-push-through (bool) avoidance-collision-lookahead-time (float) avoidance-angle-eval-span (float) avoidance-num-angle-samples (int) avoidance-safety-distance (float)

virtual void DtActiveBotNavInterface::findTransitionPointStartingFrom ( const DtVector startingPoint,
const DtVector to 
)
protectedvirtual

Finds a new transition point at the given start point.

virtual void DtActiveBotNavInterface::removeDebugTransitionPoints ( )
protectedvirtual
virtual void DtActiveBotNavInterface::setNavigationConfigParams ( DtNavBot::NavigationConfiguration navConfig)
protectedvirtual

Sets the navigation configuration from the parameters specified in the platform OPE file. The following parameters are read from the navigation-params sections: navigation-method (string: "shortcut" or "spline") use-abstract-graph (bool) min-abstract-graph-replan-distance (float)

Member Data Documentation

DtString DtActiveBotNavInterface::myProfile
protected
DtNavBot* DtActiveBotNavInterface::myNavBot
protected
DtNavArea* DtActiveBotNavInterface::myNavArea
protected
DtVector DtActiveBotNavInterface::myTransitionPoint
protected
DtNavArea* DtActiveBotNavInterface::myDestNavArea
protected
DtVector DtActiveBotNavInterface::myDestNavAreaTransitionPoint
protected
bool DtActiveBotNavInterface::myFindingDestNavAreaTransitionPoint
protected
DtNavAreaQuery::Ptr DtActiveBotNavInterface::myPendingQuery
protected
boost::shared_ptr<DtTransitionPointFinder> DtActiveBotNavInterface::myPendingPointFinder
protected
std::list<DtNavAreaQuery::WeakPtr> DtActiveBotNavInterface::myActiveQueries
protected
boost::shared_ptr<DtCoverPointFinder> DtActiveBotNavInterface::myPendingCoverPointFinder
protected
int DtActiveBotNavInterface::myControllerPriority
protected
DtString DtActiveBotNavInterface::myController
protected
DtString DtActiveBotNavInterface::myStatusString
protected
DtNavBot::DtNavBotPathLocationEvalFcn DtActiveBotNavInterface::myPathCostEvalFcn
protected
void* DtActiveBotNavInterface::myPathCostEvalFcnUsrData
protected
std::vector<DtLocalObject*> DtActiveBotNavInterface::myDebugTransitionPoints
protected
bool DtActiveBotNavInterface::myFailedToFindTransitionPoint
protected
bool DtActiveBotNavInterface::myFailedToFindCoverPoint
protected
bool DtActiveBotNavInterface::myWaitingForInitialNav
protected
bool DtActiveBotNavInterface::mySetDestinationWaitingForNav
protected
bool DtActiveBotNavInterface::myNavigationIsEnabled
protected
DtVector DtActiveBotNavInterface::myDestinationWaitingForNav
protected
DtTime DtActiveBotNavInterface::myInitialSimTime
protected
DtNavBot::NavigationMethod DtActiveBotNavInterface::myDefaultNavigationMethod
protected
boost::signals2::scoped_connection DtActiveBotNavInterface::myLocationCompleteConnection
protected
DtPlatformLocalObjectFacade DtActiveBotNavInterface::myPlatformLocalObjectFacade
protected

The documentation for this class was generated from the following file:

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)