VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfNavAreaManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vector>
14 #include <map>
15 
16 #include <matrix/vlVector.h>
19 
20 class DtTerrainInterface;
21 class DtSimManager;
22 class DtVrfObject;
23 class DtLocalVertexList;
24 class DtNavArea;
25 class DtSimMessage;
26 class Coordinate_System;
27 class DtUUID;
29 
30 namespace makArchives
31 {
32  class DtGenericTerrainRecord;
33 }
34 
36 typedef void (*DtNavAreaRemovalCallbackFcn)(DtNavArea* area,
37  void* usr);
38 
42 {
43 public:
44 
46 
48  virtual ~DtVrfNavAreaManager();
49 
50  static void tickCallback(void* args);
51 
52  //Register callback on DtIfRequestNavAreaDebugPorts messages.
53  virtual bool init();
54 
55  virtual void tick();
56 
57  virtual void setTerrainInterface(DtTerrainInterface* terrainInterface);
58 
59  static void genericRecordLoadedCallback(
60  makArchives::DtGenericTerrainRecord* record, void *user);
61  virtual void processGenericRecordLoaded(
63 
64  void loadObjectNavData(DtVrfObject* simObject);
65  void removeObjectNavData(DtVrfObject* simObject);
66  DtNavArea* areaForObject(const DtVrfObject* simObject) const;
67 
69  virtual void unloadAllNavData();
70 
75  virtual DtNavArea* findNavAreaForLocation(const DtVector& localPosition, const DtString& profile,
77  virtual std::vector<DtNavArea*> findNavAreasForLocation(const DtVector& localPosition, const DtString& profile,
79  virtual DtNavArea* findNavAreaForArea(const DtLocalVertexList* area, const DtString& profile,
81 
84  virtual void addNavAreaAboutToBeRemovedCallback(
85  DtNavAreaRemovalCallbackFcn fcn, void* usrData) const;
86 
89  virtual void removeNavAreaAboutToBeRemovedCallback(
90  DtNavAreaRemovalCallbackFcn fcn, void* usrData) const;
92 
93  //If navArea debugging is on, send debug info for all navAreas.
94  static void requestNavAreaStatusCallback(DtSimMessage*, void* usr);
95  virtual void processRequestNavAreaStatus();
96 
97  static void requestSimObjectDebugPortsCallback(DtSimMessage* msg, void* usr);
98  virtual void processRequestSimObjectDebugPortsCallback(DtUUID uuid);
99 
100  virtual void sendNavDataStatus();
101 
102  static void setGamewareWorkingMemorySize(int sizeInMb);
103  static void setRegenerateNavigationDataAtRuntime(bool regen);
104  static void setMaxRegenerationThreads(int threads);
105  static void setRegenerationDelay(double delay);
106  static void setQueryTimeBudget(double ms);
107 
108 protected:
109 
110  static void objectAboutToBeRemovedCallback(const DtVrfObject* simObject, void* userData);
111  virtual void processObjectAboutToBeRemoved(const DtVrfObject* simObject);
112 
114  virtual void invokeAreaAboutToBeDeletedCallbacks(DtNavArea*);
115 
116  static void navigationRegenUpdateCallback(void* usr);
117  virtual void processNavigationRegenUpdate();
118 
119 protected:
121 
122  typedef std::vector<DtNavArea*> DtNavAreas;
124 
125  typedef std::map<const DtVrfObject*, DtNavArea*> DtObjectNavAreaMap;
131 
133 
137  static double theRegenerationDelay;
138  static double theQueryTimeBudget;
139 
142 };
143 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
This class is just used to count the nav generation threads to ensure we do not start too many thread...
Definition: navArea.h:141
static int theGamewareWorkingMemorySize
Definition: vrfNavAreaManager.h:134
static int theMaxRegenerationThreads
Definition: vrfNavAreaManager.h:136
Coordinate_System * myObjectCoordSys
Coord system used for nav datas on embarked objects.
Definition: vrfNavAreaManager.h:130
DtTerrainInterface * myTerrainInterface
Definition: vrfNavAreaManager.h:120
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtGenericTerrainRecords allow the VR-Forces terrainInterface library to instantiate and configure the...
Definition: DtGenericTerrainRecord.h:34
bool myNavigationInitialized
Definition: vrfNavAreaManager.h:127
DtCallbackList< DtNavArea * > NavAreaAboutToBeRemovedList
Definition: vrfNavAreaManager.h:140
DtSharedVrfObjectReference class will allocate an empty DtVrfObjectReference if one is not assigned s...
Definition: vrfObjectReference.h:102
std::vector< DtNavArea * > DtNavAreas
Definition: vrfNavAreaManager.h:122
Definition: coordSystem.h:54
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
The DtVrfNavAreaManager manages all of the nav areas currently created in the sim.
Definition: vrfNavAreaManager.h:41
Contains all the data and logic for navigation within a specific area.
Definition: navArea.h:181
File: simMsg.h.
Definition: simMessage.h:35
DtTerrainInterface allows access to common terrain calls without having to know the terrain implement...
Definition: terrainInterface.h:88
DtSimManager * mySimManager
Definition: vrfNavAreaManager.h:128
DtNavAreas myNavAreas
Definition: vrfNavAreaManager.h:123
static double theQueryTimeBudget
Definition: vrfNavAreaManager.h:138
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
DtNavGenerationThreadCounter * myNavGenThreadCounter
Definition: vrfNavAreaManager.h:132
NavAreaAboutToBeRemovedList myNavAreaAboutToRemRemovedList
Definition: vrfNavAreaManager.h:141
static bool theRegenerateNavDataAtRuntime
Definition: vrfNavAreaManager.h:135
static double theRegenerationDelay
Definition: vrfNavAreaManager.h:137
class DtLocalVertexList:
Definition: localVertexList.h:20
std::map< const DtVrfObject *, DtNavArea * > DtObjectNavAreaMap
Definition: vrfNavAreaManager.h:125
DtObjectNavAreaMap myObjectNavAreas
Definition: vrfNavAreaManager.h:126
void(* DtNavAreaRemovalCallbackFcn)(DtNavArea *area, void *usr)
Callback function definition for nav area removals.
Definition: vrfNavAreaManager.h:36

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)