VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static 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. More...

Inheritance diagram for DtActiveBotNavInterface:
Inheritance graph
[legend]

Public Member Functions

virtual void firstTick ()
virtual void tick ()
virtual ~DtActiveBotNavInterface ()
virtual bool ableToNavigate () const
 Indicates whether or not this navInterface is currently able to provide navigation services for the entity.
virtual DtNavAreanavArea ()
virtual bool requestControl (int priority, const DtString &controller)
virtual bool hasControl (int priority)
virtual void releaseControl (int priority)
virtual void setDestination (const DtVector &localDest)
 Sets the destination into the navBot if it is there.
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 unsigned currentAbstractPathIndex ()
virtual void setPathCostEvalFunction (DtNavBot::DtNavBotPathLocationEvalFcn fcn, void *usr)
 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 DtVector transitionPoint () const
virtual bool usingTransitionPoint () const
virtual bool findingTransitionPoint () const
 Returns true if in the process of looking for a transition point.
virtual std::vector< DtVectorsearchInArea (double radius, double postSpacing, DtNavArea::DtPointOfInterestEvaluatorFcn=0, void *usrData=0, int navTag=-1)
 Returns a list of points that have been judged to be usable within the given area and post spacing.
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)
 Starts the process of finding the best path to any of the given destination points.
virtual bool findFarthestPositionAlongHeading (const DtVector &start, double heading, double maxDistance, DtVector &result, bool &reachedMaxDist)
 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 cancelQuery (DtNavAreaQuery::Ptr)
 Cancels the given query.
virtual void moveAlongPath (const std::vector< DtVector > &)
 Sets the bot to move along the given path. Points are in local coordinates.
virtual bool findFarthestPositionAlongHeading (double heading, double maxDistance, DtVector &result, bool &reachedMaxDist)
 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 navTagAtPosition (const DtVector &localPos) const
 Gets the nav tag of the position, if valid.
virtual DtNavTag upcomingNavTagOnPath () const
 Gets the upcoming nav tag on the path.
virtual void upcomingNavTagsOnPath (double distance, DtNavTagAndLocationList &navTags) const
 Gets all nav tags within the specified distance from the current location on the path.
- Public Member Functions inherited from DtVrfObjectNavInterface
virtual void postObjectInit ()
 Perform additional initialization after the object has been initialized.
virtual ~DtVrfObjectNavInterface ()=0
virtual void addNavAreaChangedCallback (DtNoArgumentCallbackList::DtCallbackFunctionType callback, void *usr)
virtual void removeNavAreaChangedCallback (DtNoArgumentCallbackList::DtCallbackFunctionType callback, void *usr)
virtual void invokeNavAreaChangedCallbacks ()

Static Public Member Functions

static DtVrfObjectNavInterfacecreate (DtVrfObject *vrfObject)

Protected Member Functions

 DtActiveBotNavInterface (DtVrfObject *vrfObject)
 Use the create() method instead of calling the constructor.
virtual bool init ()
 Virtual init, called from the create() method.
virtual DtNavBotnavBot ()
virtual void changingNavArea (DtNavArea *newNavArea)
 Called when the objects position is in a navArea that it was not on the previous check.
virtual void processSetLocationComplete (DtVrfObject *vrfObject)
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 bool findInsidePositionFromOutsidePosition (DtNavArea *navArea, const DtVector &localStart, const DtVector &localDest, DtVector &result, int &halfEdgeType)
virtual DtVector adjustDestination (const DtVector &localDest)
 Moves the destination to on the nav mesh if possible.
virtual DtVector localOrParentPos (const DtVector &localPos)
 If the entity is embarked, converts the provided local position to the parent frame, otherwise returns the same local position provided.
virtual DtVector objectLocationLocalOrParent ()
 Returns the local position of the entity, or the parent position if the entity is embarked.
virtual bool botShouldBeActive ()
 Checks any special conditions (other than location) for the activation/deactivation of the bot, such as the entity being destroyed.
virtual void setCollisionAvoidParams (DtNavBot::CollisionAvoidanceConfiguration &collAvoidConfig)
 Sets the collision avoidance configuration from the parameters specified in the platform OPE file.
virtual void findTransitionPointStartingFrom (const DtVector &startingPoint, const DtVector &to)
 Finds a new transition point at the given start point.
virtual void removeDebugTransitionPoints ()
virtual void setNavigationConfigParams (DtNavBot::NavigationConfiguration &navConfig)
 Sets the navigation configuration from the parameters specified in the platform OPE file.
- Protected Member Functions inherited from DtVrfObjectNavInterface
 DtVrfObjectNavInterface (DtVrfObject *vrfObject)
 Use the create() method instead of calling the constructor.
virtual bool isCollidableWhenDestroyed () const

Static Protected Member Functions

static void setLocationCompleteCallback (DtVrfObject *vrfObject, void *usr)
 Update nav bot's destination, to trigger a replan.

Protected Attributes

DtString myProfile
DtNavBotmyNavBot
DtNavAreamyNavArea
DtVector myTransitionPoint
DtNavAreaQuery::Ptr myPendingQuery
boost::shared_ptr
< DtTransitionPointFinder
myPendingPointFinder
int myControllerPriority
DtString myController
DtString myStatusString
DtNavBot::DtNavBotPathLocationEvalFcn myPathCostEvalFcn
void * myPathCostEvalFcnUsrData
std::vector
< DtSharedVrfObjectReference
myDebugTransitionPoints
bool myFailedToFindTransitionPoint
bool myWaitingForInitialNav
bool mySetDestinationWaitingForNav
bool myNavigationIsEnabled
DtVector myDestinationWaitingForNav
DtTime myInitialSimTime
- Protected Attributes inherited from DtVrfObjectNavInterface
DtVrfObjectmyVrfObject
bool myFirstTick
DtNavAreamyCurrentNavArea
DtNoArgumentCallbackList myChangedNavAreaCallbackList

Private Member Functions

 DtActiveBotNavInterface ()
 Not Implemented.
 DtActiveBotNavInterface (const DtActiveBotNavInterface &orig)
 Not Implemented.
DtActiveBotNavInterfaceoperator= (const DtActiveBotNavInterface &orig)
 Not Implemented.

Detailed Description

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.

Constructor & Destructor Documentation

DtActiveBotNavInterface::DtActiveBotNavInterface ( )
private

Not Implemented.

DtActiveBotNavInterface::DtActiveBotNavInterface ( const DtActiveBotNavInterface orig)
private

Not Implemented.

DtActiveBotNavInterface::DtActiveBotNavInterface ( DtVrfObject 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 ( DtVrfObject vrfObject)
static
virtual bool DtActiveBotNavInterface::init ( )
protectedvirtual

Virtual init, called from the create() method.

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.

virtual DtNavArea* DtActiveBotNavInterface::navArea ( )
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 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 unsigned DtActiveBotNavInterface::currentAbstractPathIndex ( )
virtual
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 DtVector DtActiveBotNavInterface::transitionPoint ( ) const
inlinevirtual
virtual bool DtActiveBotNavInterface::usingTransitionPoint ( ) const
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 bool DtActiveBotNavInterface::findFarthestPositionAlongHeading ( const DtVector start,
double  heading,
double  maxDistance,
DtVector result,
bool reachedMaxDist 
)
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 void DtActiveBotNavInterface::moveAlongPath ( const std::vector< DtVector > &  )
virtual

Sets the bot to move along the given path. Points are in local coordinates.

virtual bool DtActiveBotNavInterface::findFarthestPositionAlongHeading ( double  heading,
double  maxDistance,
DtVector result,
bool reachedMaxDist 
)
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 DtNavBot* DtActiveBotNavInterface::navBot ( )
protectedvirtual
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 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.

static void DtActiveBotNavInterface::setLocationCompleteCallback ( DtVrfObject vrfObject,
void *  usr 
)
staticprotected

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

virtual void DtActiveBotNavInterface::processSetLocationComplete ( DtVrfObject vrfObject)
protectedvirtual
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 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 ( )
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
DtNavAreaQuery::Ptr DtActiveBotNavInterface::myPendingQuery
protected
boost::shared_ptr<DtTransitionPointFinder> DtActiveBotNavInterface::myPendingPointFinder
protected
int DtActiveBotNavInterface::myControllerPriority
protected
DtString DtActiveBotNavInterface::myController
protected
DtString DtActiveBotNavInterface::myStatusString
protected
DtNavBot::DtNavBotPathLocationEvalFcn DtActiveBotNavInterface::myPathCostEvalFcn
protected
void* DtActiveBotNavInterface::myPathCostEvalFcnUsrData
protected
std::vector<DtSharedVrfObjectReference> DtActiveBotNavInterface::myDebugTransitionPoints
protected
bool DtActiveBotNavInterface::myFailedToFindTransitionPoint
protected
bool DtActiveBotNavInterface::myWaitingForInitialNav
protected
bool DtActiveBotNavInterface::mySetDestinationWaitingForNav
protected
bool DtActiveBotNavInterface::myNavigationIsEnabled
protected
DtVector DtActiveBotNavInterface::myDestinationWaitingForNav
protected
DtTime DtActiveBotNavInterface::myInitialSimTime
protected

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

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)