VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
DtNavArea Class Reference

Contains all the data and logic for navigation within a specific area. More...

Classes

struct  DtNavDataDebugInfo

Public Types

typedef DtNavArea *(* DtNavAreaCreatorFcn )()
typedef
DtOnGraphVertexVisitedResult(* 
DtPointOfInterestEvaluatorFcn )(const DtVector &localPoint, void *userData)
typedef
DtOnGraphVertexVisitedResult(* 
DtPointOfInterestNavTagEvaluatorFcn )(const DtVector &localPoint, const DtNavTag &tag, void *userData)
typedef void(* DtSearchAreaPointCostModifierEvaluatorFcn )(const DtVector &localPoint, float *currentCost, void *userData)
typedef
DtOnPathToGraphVertexComputedResult(* 
DtPathCalculatedEvaluatorFcn )(const DtVector &localPoint, double pathCost, void *userData)
typedef void(* DtSectorRegenerationCb )(void *userData)
typedef bool(* DtLocalPointUserEvalCallback )(const DtVector &localVector, DtNavAreaQuery *query, void *userData)

Public Member Functions

virtual ~DtNavArea ()
virtual bool initialize (Coordinate_System *coordSys, DtTerrainInterface *terrainIf, DtNavAreaConfig config, std::vector< DtString > profiles=std::vector< DtString >())=0
virtual void update (float deltaTimeInSeconds)=0
virtual bool loadNavData (const DtString &path, const DtVariableBindingsList &variableBindings=DtReaderWriter::nullVariableReference(), bool objectNavData=false)=0
virtual bool inNavArea (const DtVector &localPos)=0
virtual bool validPosition (const DtString &profile, const DtVector &localPos, DtNavTag *navTag=0)=0
virtual bool validForProfile (const DtString &profile) const =0
virtual DtNavDataDebugInfodebugInfo ()=0
virtual void setExtent (DtExtent *e)=0
virtual DtExtent localExtent ()=0
virtual void cancelQuery (DtNavAreaQuery::Ptr)=0
 Cancels the given query.
virtual DtNavAreaQuery::Ptr findNearbyPointOfInterest (const DtString &profile, const DtVector &startLocalPos, int tag=DtNavDataTagAny, double propagationRadius=200., DtPointOfInterestEvaluatorFcn evalFcn=0, DtPathCalculatedEvaluatorFcn pathFcn=0, void *evalFcnUserData=0)=0
 Finds a defined point of interest in the navArea with the shortest path from startLocalPos that has the specified tag (-1 matches all tags) and returns true when passed to evalFcn, if specified.
virtual DtNavAreaQuery::Ptr findNearbyPointOfInterestUsingNavTag (const DtString &profile, const DtVector &startLocalPos, int tag=DtNavDataTagAny, double propagationRadius=200., DtPointOfInterestNavTagEvaluatorFcn evalFcn=0, DtPathCalculatedEvaluatorFcn pathFcn=0, void *evalFcnUserData=0)=0
 Finds a defined point of interest in the navArea with the shortest path from startLocalPos that has the specified tag (-1 matches all tags) and returns true when passed to evalFcn, if specified.
virtual DtNavAreaQuery::Ptr findBestExitPoint (const DtString &profile, DtNavBot *searcher, const DtVector &startLocalPos, const DtVector &destination, int tag=DtNavDataTagAny, double propagationRadius=200., DtPointOfInterestEvaluatorFcn evalFcn=0, DtPathCalculatedEvaluatorFcn pathFcn=0, void *evalFcnUserData=0)=0
 Given a start and end destination outside of the nav mesh, find the best exit point matching the tag the bot can use to leave the navigation mesh.
virtual bool findInsidePositionFromOutsidePosition (const DtString &profile, double searchRadius, double searchHeight, const DtVector &fromFromHere, DtVector &result, int &halfEdgeType)=0
 Finds the closest point in the nav mesh from the given start point. If a point is found result is returned in result.
virtual DtNavAreaQuery::Ptr findBestPathTo (const DtString &profile, const DtVector &start, const std::vector< DtVector > &localDestinationPositions, DtNavBot *searcher, int tag=-1, DtSearchAreaPointCostModifierEvaluatorFcn=0, DtPointOfInterestEvaluatorFcn=0, DtPathCalculatedEvaluatorFcn=0, void *usrData=0, bool startMovingWhenFound=false)=0
 Find the best path to the given locations.
virtual DtNavAreaQuery::Ptr findPathToLocation (const DtString &profile, const DtVector &start, const DtVector &destination, bool useAbstractGraphs=true, const DtVector &locationToAvoid=DtVector(), double avoidanceRadius=0)=0
 Find path to the specified location from the specified start point.
virtual bool findFarthestPositionAlongHeading (const DtString &profile, const DtVector &start, double heading, double maxDistance, DtVector &result, bool &reachedMaxDist)=0
 Finds the farthest point along a given heading that can be traveled without hitting the border of the NavMesh, a non-traversable triangle, or the max distance.
virtual DtNavAreaQuery::Ptr generateRandomPoints (const DtString &profile, const DtVector &localAccessibilityPoint=DtVector::zero(), double minRadius=-1, double maxRadius=-1, const DtLocalVertexList &boundingArea=DtLocalVertexList(), unsigned numberOfPoints=1, double minDistanceBetweenPoints=0.0, const DtString &placementRestriction=DtString::nullString(), bool isStrict=true, bool tightlyPack=false, bool needLos=false, bool groundClamp=false, const DtLocalVertexList &leftOfLine=DtLocalVertexList(), DtLocalPointUserEvalCallback callbackFcn=emptyCallback, void *userData=0)=0
virtual bool tagVolumesToBeIntegrated () const =0
 Returns true if there are any tag volumes which still need to be integrated into the mesh.
DtVrfObjectattachedObject ()
void setAttachedObject (DtVrfObject *object)
virtual std::vector< DtVectorsearchInArea (const DtString &profile, const DtVector &startLocalPos, double radius, double postSpacing, DtNavBot *searcher, DtPointOfInterestEvaluatorFcn evalFcn=0, void *evalFcnUserData=0, int tag=-1)=0
 Returns a list of points that have been judged to be usable within the given area and post spacing.
virtual unsigned newNavTagVolumeId ()=0
 Generates a new ID for a nav tag volume.
virtual void associateNavTagVolumeIdWithObject (unsigned tagVolumeId, const DtUUID &objectUUID)=0
 Associates a nav tag volume ID with a VRF object UUID.
virtual DtUUID uuidFromNavTagVolumeId (unsigned navTagId)=0
 Returns the object UUID that is associated with this nav tag volume ID.
virtual unsigned navTagVolumeIdFromUuid (const DtUUID &objectUUID)=0
 Returns the nav tag volume ID that is associated with this object UUID.
virtual const DtNavSectorNamessectorsQueuedForRegeneration () const =0
 Returns the set of all sectors currently queued for regeneration.
virtual const DtNavSectorNamessectorsBeingRegenerated () const =0
 Returns the set of all sectors currently being regenerated.
virtual void addSectorRegenerationCallback (DtSectorRegenerationCb cb, void *usr)=0
 Installs a callback to be notified when sector regeneration status changes (i.e.
virtual void removeSectorRegenerationCallback (DtSectorRegenerationCb cb, void *usr)=0
virtual DtNavRegenRequestId requestNavDataGeneration (const DtVector &location, double radius, const std::set< DtString > &profiles=std::set< DtString >())=0
 Requests nav data regeneration at the specified location for the specified profiles.
virtual void requestNavDataReversion (DtNavRegenRequestId id)=0
 Request that nav data be regenerated to undo a previous nav data generation change.

Static Public Member Functions

static DtNavAreacreate ()
static void setNavAreaCreatorFcn (DtNavAreaCreatorFcn fcn)
static bool navAreaDebuggingEnabled ()
static void setNavAreaDebuggingEnabled (bool enable)
static bool emptyCallback (const DtVector &, DtNavAreaQuery *, void *)

Protected Attributes

DtVrfObjectmyAttachedObject
 Points to the host object if this navArea is attached to an object like a cultural feature or a large ship, for example.

Static Protected Attributes

static DtNavAreaCreatorFcn theNavAreaCreatorFcn
static bool theNavAreaDebuggingEnabled

Detailed Description

Contains all the data and logic for navigation within a specific area.

NavData is loaded for various types of entities into a DtNavArea. NavBots are created within a specific DtNavArea.

Note
This class is abstract, and must be created through the create() method.

Member Typedef Documentation

typedef DtNavArea*(* DtNavArea::DtNavAreaCreatorFcn)()
typedef DtOnGraphVertexVisitedResult(* DtNavArea::DtPointOfInterestEvaluatorFcn)(const DtVector &localPoint, void *userData)
typedef DtOnGraphVertexVisitedResult(* DtNavArea::DtPointOfInterestNavTagEvaluatorFcn)(const DtVector &localPoint, const DtNavTag &tag, void *userData)
typedef void(* DtNavArea::DtSearchAreaPointCostModifierEvaluatorFcn)(const DtVector &localPoint, float *currentCost, void *userData)
typedef DtOnPathToGraphVertexComputedResult(* DtNavArea::DtPathCalculatedEvaluatorFcn)(const DtVector &localPoint, double pathCost, void *userData)
typedef void(* DtNavArea::DtSectorRegenerationCb)(void *userData)
typedef bool(* DtNavArea::DtLocalPointUserEvalCallback)(const DtVector &localVector, DtNavAreaQuery *query, void *userData)

Constructor & Destructor Documentation

virtual DtNavArea::~DtNavArea ( )
inlinevirtual

Member Function Documentation

static DtNavArea* DtNavArea::create ( )
static
static void DtNavArea::setNavAreaCreatorFcn ( DtNavAreaCreatorFcn  fcn)
static
static bool DtNavArea::navAreaDebuggingEnabled ( )
static
static void DtNavArea::setNavAreaDebuggingEnabled ( bool  enable)
static
virtual bool DtNavArea::initialize ( Coordinate_System coordSys,
DtTerrainInterface terrainIf,
DtNavAreaConfig  config,
std::vector< DtString profiles = std::vector< DtString >() 
)
pure virtual
virtual void DtNavArea::update ( float  deltaTimeInSeconds)
pure virtual
virtual bool DtNavArea::loadNavData ( const DtString path,
const DtVariableBindingsList variableBindings = DtReaderWriter::nullVariableReference(),
bool  objectNavData = false 
)
pure virtual
Parameters
objectNavDataIndicates if this nav data is for an embarkable object, or for a terrain.
virtual bool DtNavArea::inNavArea ( const DtVector localPos)
pure virtual
virtual bool DtNavArea::validPosition ( const DtString profile,
const DtVector localPos,
DtNavTag navTag = 0 
)
pure virtual
virtual bool DtNavArea::validForProfile ( const DtString profile) const
pure virtual
virtual DtNavDataDebugInfo* DtNavArea::debugInfo ( )
pure virtual
virtual void DtNavArea::setExtent ( DtExtent e)
pure virtual
virtual DtExtent DtNavArea::localExtent ( )
pure virtual
virtual void DtNavArea::cancelQuery ( DtNavAreaQuery::Ptr  )
pure virtual

Cancels the given query.

virtual DtNavAreaQuery::Ptr DtNavArea::findNearbyPointOfInterest ( const DtString profile,
const DtVector startLocalPos,
int  tag = DtNavDataTagAny,
double  propagationRadius = 200.,
DtPointOfInterestEvaluatorFcn  evalFcn = 0,
DtPathCalculatedEvaluatorFcn  pathFcn = 0,
void *  evalFcnUserData = 0 
)
pure virtual

Finds a defined point of interest in the navArea with the shortest path from startLocalPos that has the specified tag (-1 matches all tags) and returns true when passed to evalFcn, if specified.

virtual DtNavAreaQuery::Ptr DtNavArea::findNearbyPointOfInterestUsingNavTag ( const DtString profile,
const DtVector startLocalPos,
int  tag = DtNavDataTagAny,
double  propagationRadius = 200.,
DtPointOfInterestNavTagEvaluatorFcn  evalFcn = 0,
DtPathCalculatedEvaluatorFcn  pathFcn = 0,
void *  evalFcnUserData = 0 
)
pure virtual

Finds a defined point of interest in the navArea with the shortest path from startLocalPos that has the specified tag (-1 matches all tags) and returns true when passed to evalFcn, if specified.

The point evaluator function is passed the full nav tag so that it may be used in evaluation.

virtual DtNavAreaQuery::Ptr DtNavArea::findBestExitPoint ( const DtString profile,
DtNavBot searcher,
const DtVector startLocalPos,
const DtVector destination,
int  tag = DtNavDataTagAny,
double  propagationRadius = 200.,
DtPointOfInterestEvaluatorFcn  evalFcn = 0,
DtPathCalculatedEvaluatorFcn  pathFcn = 0,
void *  evalFcnUserData = 0 
)
pure virtual

Given a start and end destination outside of the nav mesh, find the best exit point matching the tag the bot can use to leave the navigation mesh.

virtual bool DtNavArea::findInsidePositionFromOutsidePosition ( const DtString profile,
double  searchRadius,
double  searchHeight,
const DtVector fromFromHere,
DtVector result,
int halfEdgeType 
)
pure virtual

Finds the closest point in the nav mesh from the given start point. If a point is found result is returned in result.

virtual DtNavAreaQuery::Ptr DtNavArea::findBestPathTo ( const DtString profile,
const DtVector start,
const std::vector< DtVector > &  localDestinationPositions,
DtNavBot searcher,
int  tag = -1,
DtSearchAreaPointCostModifierEvaluatorFcn  = 0,
DtPointOfInterestEvaluatorFcn  = 0,
DtPathCalculatedEvaluatorFcn  = 0,
void *  usrData = 0,
bool  startMovingWhenFound = false 
)
pure virtual

Find the best path to the given locations.

virtual DtNavAreaQuery::Ptr DtNavArea::findPathToLocation ( const DtString profile,
const DtVector start,
const DtVector destination,
bool  useAbstractGraphs = true,
const DtVector locationToAvoid = DtVector(),
double  avoidanceRadius = 0 
)
pure virtual

Find path to the specified location from the specified start point.

virtual bool DtNavArea::findFarthestPositionAlongHeading ( const DtString profile,
const DtVector start,
double  heading,
double  maxDistance,
DtVector result,
bool reachedMaxDist 
)
pure virtual

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

static bool DtNavArea::emptyCallback ( const DtVector ,
DtNavAreaQuery ,
void *   
)
static
virtual DtNavAreaQuery::Ptr DtNavArea::generateRandomPoints ( const DtString profile,
const DtVector localAccessibilityPoint = DtVector::zero(),
double  minRadius = -1,
double  maxRadius = -1,
const DtLocalVertexList boundingArea = DtLocalVertexList(),
unsigned  numberOfPoints = 1,
double  minDistanceBetweenPoints = 0.0,
const DtString placementRestriction = DtString::nullString(),
bool  isStrict = true,
bool  tightlyPack = false,
bool  needLos = false,
bool  groundClamp = false,
const DtLocalVertexList leftOfLine = DtLocalVertexList(),
DtLocalPointUserEvalCallback  callbackFcn = emptyCallback,
void *  userData = 0 
)
pure virtual
virtual bool DtNavArea::tagVolumesToBeIntegrated ( ) const
pure virtual

Returns true if there are any tag volumes which still need to be integrated into the mesh.

DtVrfObject* DtNavArea::attachedObject ( )
inline
void DtNavArea::setAttachedObject ( DtVrfObject object)
inline
virtual std::vector<DtVector> DtNavArea::searchInArea ( const DtString profile,
const DtVector startLocalPos,
double  radius,
double  postSpacing,
DtNavBot searcher,
DtPointOfInterestEvaluatorFcn  evalFcn = 0,
void *  evalFcnUserData = 0,
int  tag = -1 
)
pure 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

virtual unsigned DtNavArea::newNavTagVolumeId ( )
pure virtual

Generates a new ID for a nav tag volume.

virtual void DtNavArea::associateNavTagVolumeIdWithObject ( unsigned  tagVolumeId,
const DtUUID objectUUID 
)
pure virtual

Associates a nav tag volume ID with a VRF object UUID.

virtual DtUUID DtNavArea::uuidFromNavTagVolumeId ( unsigned  navTagId)
pure virtual

Returns the object UUID that is associated with this nav tag volume ID.

If not found, an invalid UUID will be returned.

virtual unsigned DtNavArea::navTagVolumeIdFromUuid ( const DtUUID objectUUID)
pure virtual

Returns the nav tag volume ID that is associated with this object UUID.

If not found, an invalid (0) UUID will be returned.

virtual const DtNavSectorNames& DtNavArea::sectorsQueuedForRegeneration ( ) const
pure virtual

Returns the set of all sectors currently queued for regeneration.

virtual const DtNavSectorNames& DtNavArea::sectorsBeingRegenerated ( ) const
pure virtual

Returns the set of all sectors currently being regenerated.

virtual void DtNavArea::addSectorRegenerationCallback ( DtSectorRegenerationCb  cb,
void *  usr 
)
pure virtual

Installs a callback to be notified when sector regeneration status changes (i.e.

regen queued, started, or completed).

virtual void DtNavArea::removeSectorRegenerationCallback ( DtSectorRegenerationCb  cb,
void *  usr 
)
pure virtual
virtual DtNavRegenRequestId DtNavArea::requestNavDataGeneration ( const DtVector location,
double  radius,
const std::set< DtString > &  profiles = std::set< DtString >() 
)
pure virtual

Requests nav data regeneration at the specified location for the specified profiles.

If no specific profiles are requested, data will be regenerated for all profiles. The location must be specified in local terrain coordinates.

virtual void DtNavArea::requestNavDataReversion ( DtNavRegenRequestId  id)
pure virtual

Request that nav data be regenerated to undo a previous nav data generation change.

Member Data Documentation

DtNavAreaCreatorFcn DtNavArea::theNavAreaCreatorFcn
staticprotected
bool DtNavArea::theNavAreaDebuggingEnabled
staticprotected
DtVrfObject* DtNavArea::myAttachedObject
protected

Points to the host object if this navArea is attached to an object like a cultural feature or a large ship, for example.


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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)