![]() |
VR-Forces 5.0.2 Developer's Guide
|
This class contains all the data and logic for navigation within a specific area. Nav Data may be loaded for multiple types (profiles) of entities into a single DtNavArea. NavBots are created within a specific DtNavArea and represent entities in this area.
Classes | |
| struct | DtNavDataDebugInfo |
| struct | DtNavTriangleInfo |
| struct | DtNavTriangleInfoExt |
Public Types | |
| typedef unsigned | NavAreaId |
| 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 (NavAreaId navAreaId, Coordinate_System *coordSys, DtTerrainInterface *terrainIf, DtNavAreaConfig config, DtNavGenerationThreadCounter *threadCounter, bool parallelQueryQueueProcessing=false, std::vector< DtString > profiles=std::vector< DtString >())=0 |
| virtual NavAreaId | navAreaId () const =0 |
| virtual void | update (float deltaTimeInSeconds)=0 |
| virtual void | processQueues ()=0 |
| virtual bool | loadNavData (const DtString &path, const DtVariableBindingsList &variableBindings=DtReaderWriter::nullVariableReference(), bool objectNavData=false)=0 |
| virtual bool | inNavArea (const DtVector &localPos) const =0 |
| virtual bool | validPosition (const DtString &profile, const DtVector &localPos, DtNavTag *navTag=0, DtVector *outPos=0)=0 |
| virtual bool | navTopoPosition (const DtVector &localPosition, DtVector &navPosition) const =0 |
| virtual bool | localPosition (const DtVector &navPosition, DtVector &localPosition) const =0 |
| virtual bool | navTopoVector (const DtVector &localVector, DtVector &navVector) const =0 |
| virtual bool | localVector (const DtVector &navPosition, DtVector &localVector) const =0 |
| virtual bool | validForProfile (const DtString &profile) const =0 |
| virtual DtNavDataDebugInfo * | debugInfo ()=0 |
| virtual void | setExtent (DtExtent *e)=0 |
| virtual DtExtent | localExtent ()=0 |
| virtual void | cancelQuery (DtNavAreaQuery::Ptr)=0 |
| 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 |
| virtual DtNavAreaQuery::Ptr | findNearbyPointOfInterestUsingNavTag (const DtString &profile, const DtVector &startLocalPos, bool useHighPriorityQueue, int tag=DtNavDataTagAny, double propagationRadius=200., DtPointOfInterestNavTagEvaluatorFcn evalFcn=0, DtPathCalculatedEvaluatorFcn pathFcn=0, void *evalFcnUserData=0)=0 |
| virtual void | findNearbyNavEdgesUsingNavTags (const DtString &profile, double searchRadius, const DtVector &fromFromHere, const std::vector< DtInputNavTag > &navTagVals, std::list< const DtNavEdge * > &result) const =0 |
| virtual void | findVerticesUsingNavTags (const DtString &profile, double searchRadius, const DtVector &fromFromHere, const std::vector< DtInputNavTag > &navTagVals, std::list< DtVector > &result) const =0 |
| 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 |
| virtual bool | findInsidePositionFromOutsidePosition (const DtString &profile, double searchRadius, double searchHeight, const DtVector &fromFromHere, DtVector &result, int &halfEdgeType) const =0 |
| 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 |
| virtual DtNavAreaQuery::Ptr | findPathToLocation (const DtString &profile, const DtVector &start, const DtVector &destination, bool useAbstractGraphs=true, const DtVector &locationToAvoid=DtVector(), double avoidanceRadius=0, DtNavBot::DtNavBotPathLocationEvalFcn costEvalFcn=0, void *costEvalFcnUsrData=0)=0 |
| virtual bool | findFarthestPositionAlongHeading (const DtString &profile, const DtVector &start, double heading, double maxDistance, DtVector &result, bool &reachedMaxDist) const =0 |
| virtual bool | doesNavIntersectBetweenTwoPoints (const DtString &profile, const DtVector &start, const DtVector &end) const =0 |
| virtual DtPersistentPointAlongHeadingQuery * | createPeristentPointAlongHeadingQuery (const DtString &profile) const =0 |
| virtual DtObjectsCollectorInExtentQuery * | createObjectsCollectorInExtentQuery (const DtString &profile) const =0 |
| 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 |
| const DtSimObject * | attachedObject () |
| void | setAttachedObject (const DtSimObject *object) |
| virtual std::vector< DtVector > | searchInArea (const DtString &profile, const DtVector &startLocalPos, double radius, double postSpacing, DtNavBot *searcher, DtPointOfInterestEvaluatorFcn evalFcn=0, void *evalFcnUserData=0, int tag=-1) const =0 |
| virtual bool | navTrianglesInArea (const DtString &profile, const DtVector &location, double radius, std::list< DtNavTriangleInfo > &triangles)=0 |
| virtual unsigned | newNavTagId ()=0 |
| virtual void | associateNavTagIdWithObject (unsigned tagVolumeId, const DtUUID &objectUUID)=0 |
| virtual void | disassociateNavTagId (unsigned navTagId)=0 |
| virtual DtUUID | uuidFromNavTagId (unsigned navTagId) const =0 |
| virtual unsigned | navTagVolumeIdFromUuid (const DtUUID &objectUUID)=0 |
| virtual const DtNavSectorNames & | sectorsQueuedForRegeneration () const =0 |
| virtual const DtNavSectorNames & | sectorsBeingRegenerated () const =0 |
| virtual void | addSectorRegenerationCallback (DtSectorRegenerationCb cb, void *usr)=0 |
| 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 |
| virtual void | requestNavDataReversion (DtNavRegenRequestId id)=0 |
| virtual void | pauseNavDataRegeneration ()=0 |
| virtual void | resumeNavDataRegeneration ()=0 |
| virtual bool | revertNavData ()=0 |
| virtual unsigned | addNavEdge (const DtString &profile, std::vector< DtVector > &LocalPoints, const DtInputNavTag &navTag, const DtUUID &associatedObject=DtUUID::nullUUID())=0 |
| virtual unsigned | addNavIEdge (const DtString &profile, std::vector< DtVector > &LocalPoints, std::vector< std::vector< DtVector > > &localIPoints, const DtInputNavTag &navTag, const DtInputNavTag &entryExitNavTag, const DtUUID &associatedObject=DtUUID::nullUUID())=0 |
| virtual void | removeNavEdge (unsigned edgeId)=0 |
| virtual unsigned | addCoverPoint (const DtString &profile, const DtVector &localPoint, bool &creationComplete)=0 |
| virtual bool | isCoverPointCreated (unsigned coverPointId)=0 |
| virtual void | removeCoverPoint (unsigned coverPointId)=0 |
| virtual unsigned | numberOfPendingQueries () const =0 |
| virtual void | printNavDataInfoForLocation (const DtVector &location, std::ostream &strm) const =0 |
| virtual double | areaWidth () const =0 |
| virtual double | areaLength () const =0 |
Static Public Member Functions | |
| static DtNavArea * | create () |
| static void | setNavAreaCreatorFcn (DtNavAreaCreatorFcn fcn) |
| static bool | emptyCallback (const DtVector &, DtNavAreaQuery *, void *) |
| static bool | navAreaDebuggingEnabled () |
| static void | setNavAreaDebuggingEnabled (bool enable) |
Protected Attributes | |
| const DtSimObject * | myAttachedObject |
Static Protected Attributes | |
| static DtNavAreaCreatorFcn | theNavAreaCreatorFcn |
| static bool | theNavAreaDebuggingEnabled |
| typedef unsigned DtNavArea::NavAreaId |
| 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) |
|
inlinevirtual |
|
static |
|
static |
When Nav Area debugging is enabled, the Navigation Lab software can connect to a Nav Area to debug issues with navigation. There is a performance impact. Disabled by default.
|
static |
When Nav Area debugging is enabled, the Navigation Lab software can connect to a Nav Area to debug issues with navigation. There is a performance impact. Disabled by default.
|
pure virtual |
|
pure virtual |
Unique id assigned to this Nav Area at initialization.
|
pure virtual |
Function called to perform navigation related tasks for this area.
|
pure virtual |
Function to process navigation query queues. This is only for parallel queue processing and should not be called except by those threads.
|
pure virtual |
Loads Nav Data for this area.
| objectNavData | Indicates if this nav data is for an embarkable object, or for a terrain. |
Returns true if the given location is in this Nav Area.
|
pure virtual |
Tests to see if the position is on the nav mesh part of the nav area, i.e. on a traversable part. If there is a nav tag associated with the triangle found and navTag is provided, the tag value will be returned. If outPos is provided, it will be filled in with the projected position of the input point onto the triangle found.
|
pure virtual |
Calculates the raw nav area coordinates, which are essentially topographic, given a position in local coordinates. Returns true if successful.
|
pure virtual |
Calculates the local terrain coordinates given a position in nav area coordinates. Returns true if successful.
|
pure virtual |
Calculates a direction vector in nav area coordinates, given a vector in local coordinates. Returns true if successful.
|
pure virtual |
Calculates a direction vector in local coordinates, given a vector in nav area coordinates. Returns true if successful.
Returns true if this area is valid for the given navigation profile.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Returns the dimensions of the area.
|
pure virtual |
Returns the dimensions of the area.
|
pure virtual |
Cancels the given query.
|
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.
|
pure virtual |
Returns a query that 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.
|
pure virtual |
Finds nearby Nav Edges in the Nav Graph from the given start point and matches one of the given tags. User is responsible for deleting result.
|
pure virtual |
Finds nearby points in the nav graph from the given start point matching one of the given tags.
|
pure virtual |
Returns a query that finds the best exit point matching the tag that the bot can use to leave the navigation mesh based on the given a start and end destination outside of the Nav Area.
|
pure virtual |
Finds the closest point in the nav mesh from the given start point. If a point is found, the location of the point is returned in result.
|
pure virtual |
Returns a query that finds the best path through multiple destination locations.
|
pure virtual |
Returns a query that finds a path to the specified location from the specified start point.
|
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.
|
pure virtual |
Attempts to find a between two points. Similar to findFarthestPosition but takes a 2nd point for sampling rather than heading and distance.
|
pure virtual |
|
pure virtual |
|
static |
|
pure virtual |
Returns a query to generate some number of random points. If localAccessibilityPoint is set, all points must be navigable from the access point. If boundingArea is set, all points must be inside the area, ignoring elevation. Note that this will not cause points to be generated outside the navArea. If boundingArea is not set, and radius is set, points will be generated using radius as a maximum distance from accessibilityPoint. If minDistanceBetweenPoints is set, generated points will be tested against the rest of the set of random points to make sure none are within the given distance of each other. If placementRestriction is set to one of the MovementMode strings (e.g. DtMovementModePreferRoads), points will be chosen that match that criteria. If isStrict is true, only points matching the placementRestriction will be generated, even if we can't create enough to match the desired number. If tightlyPack is true, points closer to access point or bounding area center will be favored. If needLos is true, will try to choose points that should have LOS to the specified access point. If groundClamp is true, points will be ground clamped to the terrain at a point below the original point plus the height of the entity specified in nav generation. If leftOfLine, the points specified will be considered a line, and only points to the left of that line will be generated. If callbackFcn is set, this user function is called on each generated point, to test if each point is acceptable.
|
pure virtual |
Returns true if there are any tag volumes which still need to be integrated into the mesh.
|
inline |
If this Nav Area is attached to a sim object, returns that object.
|
inline |
Sets the sim object his Nav Ara is attached to.
|
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:
|
pure virtual |
Returns the nav triangles within the given radius of the specified location.
|
pure virtual |
Generates a new unique ID for a nav tag volume.
|
pure virtual |
Associates a nav tag ID with a VRF object UUID.
|
pure virtual |
Disassociates a nav tag ID with a VRF object UUID.
Returns the object UUID that is associated with this nav tag ID. If not found, an invalid UUID will be returned.
Returns the nav tag ID that is associated with this object UUID. If not found, an invalid (0) UUID will be returned.
|
pure virtual |
Returns the set of all sectors currently queued for regeneration.
|
pure virtual |
Returns the set of all sectors currently being regenerated.
|
pure virtual |
Installs a callback to be notified when sector regeneration status changes (i.e. regen queued, started, or completed).
|
pure virtual |
|
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.
|
pure virtual |
Request that nav data be regenerated to undo a previous nav data generation change.
|
pure virtual |
Pause nav data regeneration.
|
pure virtual |
Resume nav data regeneration.
|
pure virtual |
Reverts all modified nav data to the original data defined in the files.
|
pure virtual |
Adds a nav edge and returns an edge id that can be used to remove it. Returns 0 if it fails. If associatedObject is not null, an association will be made between the nav edge and the object.
|
pure virtual |
Adds a nav edge and returns an edge id that can be used to remove it. Returns 0 if it fails. If associatedObject is not null, an association will be made between the nav edge and the object.
|
pure virtual |
Remove nav edge by its id.
|
pure virtual |
Adds a cover point and returns an edge id that can be used to remove it. Returns 0 if it fails. The creationComplete flag indicates if creation of the point completed or if further work is required.
Returns true if the creation of the specified cover point is complete.
|
pure virtual |
Remove cover point by its id.
|
pure virtual |
Returns the number of pending queries for this nav area.
|
pure virtual |
Prints information about the nav data at the specified location to the given stream.
|
staticprotected |
|
staticprotected |
|
protected |
Points to the host object if this navArea is attached to an object like a cultural feature or a large ship, for example.