![]() |
VR-Forces Developer's Guide
|
The DtVrfNavAreaManager manages all of the nav areas currently created in the sim.
Classes | |
| struct | navAreaExtentData |
Public Member Functions | |
| DtVrfNavAreaManager (DtSimulationServices *manager) | |
| virtual | ~DtVrfNavAreaManager () |
| virtual bool | init () |
| virtual void | tick () |
| virtual void | unloadAllNavData () |
| virtual void | revertNavData () |
| virtual void | pauseNavDataRegeneration () |
| virtual void | resumeNavDataRegeneration () |
| virtual void | addNavArea (DtNavArea *a) |
| virtual DtNavArea * | loadNavArea (DtNavArea::NavAreaId id, const DtFilename &filename) |
| virtual DtNavArea * | loadNavDataForObject (DtNavArea::NavAreaId id, const DtFilename &filename, const DtSimObject *simObject, const DtReaderWriter::SearchPaths &searchPaths=DtReaderWriter::SearchPaths()) |
| virtual void | loadAllNavData (bool *dataAvailable=0) |
| virtual DtNavArea::NavAreaId | nextNavAreaId () |
| virtual DtString | findNavAreaNameForLocation (const DtVector &localPosition, const DtString &profile, bool loadNavAreas=true, const DtSimObject *parentObject=nullptr) |
| virtual void | addNavAreaAboutToBeRemovedCallback (DtNavAreaRemovalCallbackFcn fcn, void *usrData) const |
| virtual void | removeNavAreaAboutToBeRemovedCallback (DtNavAreaRemovalCallbackFcn fcn, void *usrData) const |
| virtual void | setBlockingNavDataLoad (bool b) |
| virtual void | sendNavDataStatus () |
| virtual void | processNavQueues () |
| virtual void | processSimObjectDeleted (const DtSimObject *simObject) |
| virtual void | invokeAreaAboutToBeDeletedCallbacks (DtNavArea *) |
| void | processUnloadTerrain () |
| virtual void | updateSimOperationStatus () |
| void | setBlockOnAsynchronousOperations (bool block) |
| bool | hasAsynchronousOperationsPending () const |
| virtual void | setTerrainInterface (DtTerrainInterface *terrainInterface) |
| virtual DtTerrainInterface * | terrainInterface () |
| void | loadObjectNavData (const DtSimObject *simObject, const DtReaderWriter::SearchPaths &searchPaths=DtReaderWriter::SearchPaths()) |
| void | removeObjectNavData (const DtSimObject *simObject) |
| DtNavArea * | areaForObject (const DtSimObject *simObject) const |
| virtual DtNavArea * | findNavAreaForLocation (const DtVector &localPosition, const DtString &profile, const DtSimObject *parentObject=nullptr, bool *dataAvailable=nullptr) |
| virtual std::vector< DtNavArea * > | findNavAreasForLocation (const DtVector &localPosition, const DtString &profile, DtTerrainCategoryMask terrainCategoryMask, const DtSimObject *parentObject=nullptr, bool *dataAvailable=nullptr, const DtAttachedTerrain *terrainAttachedTo=0, bool loadNavAreas=true) |
| virtual std::vector< DtNavArea * > | findNavAreasForArea (const DtLocalVertexList *boundingArea, const DtString &profile, const DtSimObject *=nullptr, bool *dataAvailable=nullptr) |
| virtual DtNavArea * | findNavAreaForArea (const DtLocalVertexList *area, const DtString &profile, const DtSimObject *parentObject=nullptr, bool *dataAvailable=nullptr) |
| virtual std::vector< DtNavArea * > | findNavAreasForLocation (const DtVector &localPosition) const |
Static Public Member Functions | |
| static void | tickCallback (void *args) |
| static void | setGamewareWorkingMemorySize (int sizeInMb) |
| static void | setRegenerateNavigationDataAtRuntime (bool regen) |
| static void | setMaxRegenerationThreads (int threads) |
| static void | setNumberOfNavQueueProcessingThreads (int threads) |
| static void | setRegenerationDelay (double delay) |
| static void | setQueryTimeBudget (double ms) |
| static void | setRegenerationFileDirectory (const DtFilename &dir) |
Public Attributes | |
| DtNavGenerationThreadCounter * | myNavGenThreadCounter |
Static Public Attributes | |
| static int | theGamewareWorkingMemorySize |
| static bool | theRegenerateNavDataAtRuntime |
| static int | theMaxRegenerationThreads |
| static int | theNumberOfNavQueueProcessingThreads |
| static double | theRegenerationDelay |
| static double | theQueryTimeBudget |
| static DtFilename | theRegenerationFileDirectory |
Protected Types | |
| typedef std::vector< DtNavArea * > | DtNavAreas |
| typedef std::map< DtUUID, DtNavArea * > | DtObjectNavAreaMap |
| typedef std::queue < DtTerrainChangeNotificationInfo > | DtNavAreaTerrainChangesQueue |
| typedef std::map < DtNavArea::NavAreaId, DtNavAreaTerrainChangesQueue * > | DtNavAreasTerrainChangesQueues |
| typedef std::map < DtNavArea::NavAreaId, DtExtent > | DtNavAreasLocalExtents |
| typedef DtCallbackList < DtNavArea * > | NavAreaAboutToBeRemovedList |
Protected Member Functions | |
| virtual void | processNavAreasTerrainChangesQueues () |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| DtVrfNavAreaManager::DtVrfNavAreaManager | ( | DtSimulationServices * | manager | ) |
|
virtual |
destructor
|
static |
|
virtual |
Registers a callback on DtIfRequestNavAreaDebugPorts messages.
|
virtual |
Ticks each nav area, in parallel unless configured otherwise.
|
virtual |
The terrain interface used by this nav area manager.
|
inlinevirtual |
The terrain interface used by this nav area manager.
|
static |
Callback to processes terrain records indicating nav areas to be loaded. Prepares the area for loading when first requested.
|
virtual |
Callback to processes terrain records indicating nav areas to be loaded. Prepares the area for loading when first requested.
| void DtVrfNavAreaManager::loadObjectNavData | ( | const DtSimObject * | simObject, |
| const DtReaderWriter::SearchPaths & | searchPaths = DtReaderWriter::SearchPaths() |
||
| ) |
Manage nav data attached to entities, such as ships or other large objects that can be traversed by smaller entities.
| void DtVrfNavAreaManager::removeObjectNavData | ( | const DtSimObject * | simObject | ) |
Manage nav data attached to entities, such as ships or other large objects that can be traversed by smaller entities.
| DtNavArea* DtVrfNavAreaManager::areaForObject | ( | const DtSimObject * | simObject | ) | const |
Manage nav data attached to entities, such as ships or other large objects that can be traversed by smaller entities.
|
virtual |
Clears all nav areas from the manager. Used when the terrain is being closed.
|
virtual |
Reverts all loaded nav data to defaults.
|
virtual |
Pauses all nav data regeneration until resumeNavDataRegeneration() is called.
|
virtual |
Resumes nav data regeneration if paused.
|
virtual |
Called after loading the data for a nav area. Does not actually load any data, just gives ownership to the manager. Typically only called internally.
|
virtual |
Loads nav data for an area from the given file, assigns it the given id, and then calls addNavArea to add it to the manager. Typically only called internally.
|
virtual |
Loads nav data for an area on a sim object from the given file, assigns it the given id, and then calls addNavArea to add it to the manager. Typically only called internally.
|
virtual |
Loads all nav data (if any). Typically only called internally.
|
virtual |
Returns a new unique nav area id. Typically only called internally.
|
virtual |
Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl.
| localPosition | The location to check, in local terrain coordinates. |
| profile | Navigation profile to be considered, as defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If profile is a null string, nav areas for all profiles are considered to be matching. |
| parentObject | If specified, only nav areas that are attached to parentObject are considered. Otherwise, nav area on the terrain are considered. |
| loadNavAreas | If true, any unloaded nav areas that overlap this location will be loaded. |
| dataAvailable | If non-null, this will be set to true if data is available for the given location. If data is not yet loaded, this will be set to false and no nav areas will be returned. |
|
virtual |
Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl.
| localPosition | The location to check, in local terrain coordinates. |
| profile | Navigation profile to be considered, as defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If profile is a null string, nav areas for all profiles are considered to be matching. |
| parentObject | If specified, only nav areas that are attached to parentObject are considered. Otherwise, nav area on the terrain are considered. |
| loadNavAreas | If true, any unloaded nav areas that overlap this location will be loaded. |
| dataAvailable | If non-null, this will be set to true if data is available for the given location. If data is not yet loaded, this will be set to false and no nav areas will be returned. |
|
virtual |
Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl.
| localPosition | The location to check, in local terrain coordinates. |
| profile | Navigation profile to be considered, as defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If profile is a null string, nav areas for all profiles are considered to be matching. |
| parentObject | If specified, only nav areas that are attached to parentObject are considered. Otherwise, nav area on the terrain are considered. |
| loadNavAreas | If true, any unloaded nav areas that overlap this location will be loaded. |
| dataAvailable | If non-null, this will be set to true if data is available for the given location. If data is not yet loaded, this will be set to false and no nav areas will be returned. |
|
virtual |
Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl.
| localPosition | The location to check, in local terrain coordinates. |
| profile | Navigation profile to be considered, as defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If profile is a null string, nav areas for all profiles are considered to be matching. |
| parentObject | If specified, only nav areas that are attached to parentObject are considered. Otherwise, nav area on the terrain are considered. |
| loadNavAreas | If true, any unloaded nav areas that overlap this location will be loaded. |
| dataAvailable | If non-null, this will be set to true if data is available for the given location. If data is not yet loaded, this will be set to false and no nav areas will be returned. |
|
virtual |
Will only check currently loaded nav areas and will return regardless of matching profile.
|
virtual |
Finds the name of any nav area that contains a given location and matches the specified profile. This is used to identify whether a nav area exists for a location without triggering the loading of any nav areas. If there is no nav area present at the location, it will return an empty string. If loadNavAreas is true, it will also cause any nav areas at the location to be loaded. Specify parentObject if the nav area is attached to another sim object.
|
virtual |
Add a callback for when a nav area is about to be removed.
|
virtual |
Remove a previously registered callback for notification when a new area is about to be removed.
|
virtual |
If set to true, nav data loading blocks and loads immediately. Otherwise, nav data loading occurs in a separate thread and may not be immediately available on request.
|
static |
If navArea debugging is on, sends debug info for all navAreas.
|
virtual |
If navArea debugging is on, sends debug info for all navAreas.
|
static |
Callback to processes a request for the nav debug ports.
|
virtual |
Callback to processes a request for the nav debug ports.
|
virtual |
Sends the current nav data status.
|
virtual |
Should only be called by the parallel nav queue processing threads.
|
static |
Set navigation configuration.
|
static |
Set navigation configuration.
|
static |
Set navigation configuration.
|
static |
Set navigation configuration.
|
static |
Set navigation configuration.
|
static |
Set navigation configuration.
|
static |
Set navigation configuration.
|
virtual |
Processes the deletion of a sim object that has its own nav data.
|
virtual |
Invoke callbacks when a nav area is removed.
|
static |
Callback to send status on navigation regeneration.
|
virtual |
Callback to send status on navigation regeneration.
| void DtVrfNavAreaManager::processUnloadTerrain | ( | ) |
|
virtual |
| void DtVrfNavAreaManager::setBlockOnAsynchronousOperations | ( | bool | block | ) |
| bool DtVrfNavAreaManager::hasAsynchronousOperationsPending | ( | ) | const |
|
staticprotected |
Callback for terrain change notifications. Processes a dynamic terrain change, triggering nav data regeneration if necessary. The terrain changes are added to queues for each nav area. They are processed when the nav area gets loaded.
| terrainChangeInfo | - provides the info for the terrain change - i.e. spatial extent, type of the change |
| usr | this |
|
protected |
Callback for terrain change notifications. Processes a dynamic terrain change, triggering nav data regeneration if necessary. The terrain changes are added to queues for each nav area. They are processed when the nav area gets loaded.
| terrainChangeInfo | - provides the info for the terrain change - i.e. spatial extent, type of the change |
| usr | this |
|
protectedvirtual |
Pass the terrain changes to the loaded nav areas.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Map of queues with terrain changes - created for each nav area. The terrain changes are added to the queues by the callback for the terrain change notifications.
|
protected |
Map of the the nav areas extents - converted to local coordinates. It is used within the terain chages processing.
|
protected |
Indicates if the DtVrfNavAreaManager has a terrain notifications callback registered with the DtVantageTerrainEngine. The instance of the DtVantageTerrainEngine gets deleted when a the terrain/scenario is unloaded - the callback is lost. A new instance of the DtVantageTerrainEngine gets created when a new terrain/scenario is loaded - a new callback has to be registered.
|
protected |
|
protected |
|
protected |
Coord system used for nav datas on embarked objects.
|
protected |
|
protected |
| DtNavGenerationThreadCounter* DtVrfNavAreaManager::myNavGenThreadCounter |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |