23 class AbstractGraphCellGrid;
24 class NavMeshGenParameters;
25 class NavMeshElementManager;
26 class NavGraphManager;
27 class ITriangleCostMap;
33 class DisplayListManager;
34 class PerformQueryStatistics;
47 RayCanGoMarginModeCount
65 virtual const char* GetTypeName()
const {
return "Database"; }
76 DatabasePositionSpatializationRange& GetDatabasePositionSpatializationRange() {
return m_positionSpatializationRange; }
77 const DatabasePositionSpatializationRange& GetDatabasePositionSpatializationRange()
const {
return m_positionSpatializationRange; }
78 const PositionSpatializationRange& GetPositionSpatializationRange()
const {
return m_positionSpatializationRange.GetPositionSpatializationRange(); }
80 KyResult SetSpatializationRange(
KyFloat32 abovePosition,
KyFloat32 belowPosition) {
return m_positionSpatializationRange.SetSpatializationRange(abovePosition, belowPosition); }
95 KyUInt32 GetAliveNavDataCount()
const {
return m_navDatas.GetCount() + m_navDataToBeRemoved.GetCount() + m_navDataBeeingRemoved.GetCount(); }
99 KyUInt32 GetBotsCount()
const {
return m_bots.GetCount(); }
100 Bot* GetBot(
KyUInt32 index)
const {
return m_bots[index]; }
114 const DatabaseChange& GetChangesSinceLastReset()
const {
return m_lastChange; }
115 void ResetLastChanges() {
return m_lastChange.ClearChange(); }
117 void AddChangeListener(
const Ptr<IDatabaseChangeListener>& changeListener) { m_databaseChangeListeners.PushBackUnique(changeListener); }
118 void RemoveChangeListener(
const Ptr<IDatabaseChangeListener>& changeListener) { m_databaseChangeListeners.RemoveFirstOccurrence(changeListener); }
121 Database(World* world,
KyUInt32 databaseIndex);
126 virtual void DoSendVisualDebug(VisualDebugServer& visualDebugServer, VisualDebugSendChangeEvent changeEvent);
131 void SetEventBroadcaster(IDatabaseChangeBroadcaster* eventBroadCaster);
132 void UpdateImmediate();
151 void BuildVisualGeometry(
bool forceRebuildAll =
false) { m_geometryBuildingManager.BuildGeometry(forceRebuildAll); }
156 void BuildVisualGeometry(Ptr<IVisualGeometry> geometry,
const DatabaseVisualGeometryBuilderConfig& config = DatabaseVisualGeometryBuilderConfig());
166 IVisualGeometryFactory* GetVisualGeometryFactory()
const {
return m_geometryBuildingManager.GetVisualGeometryFactory(); }
170 ActiveData* GetActiveData()
const {
return m_activeData; }
172 void RecomputeAllTriangleCostMapInBox(
const CellBox& cellBox);
175 void StartNavDataAddRemoveUpdate(QueryProcessMode processMode);
176 bool IsThereNavDataAddRemovePending()
const {
return m_navDataToBeAdded.GetCount() + m_navDataToBeRemoved.GetCount() != 0; }
177 bool IsDoingNavDataAddRemoveUpdate()
const {
return m_navDataBeeingAdded.GetCount() + m_navDataBeeingRemoved.GetCount() != 0; }
178 void FinalizeNavDataAddRemoveUpdate();
181 void FinalizeTagVolumeIntegrationUpdate(
const CellBox& tagVolumeChangeCellBox);
183 void UpdateBotsPathFollowing(
KyFloat32 simulationTimeInSeconds);
184 void UpdateBotsGenMetrics();
189 void SetupGenerationMetrics(
const NavMeshGenParameters& navMeshGenParameters);
191 KyUInt32 GetActiveNavMeshChangeIdx()
const {
return m_activeChangeIdx.m_navMeshChangeIdx; }
192 KyUInt32 GetActiveNavGraphChangeIdx()
const {
return m_activeChangeIdx.m_navGraphChangeIdx; }
193 KyUInt32 GetActiveAbstractGraphChangeIdx()
const {
return m_activeChangeIdx.m_abstractGraphChangeIdx; }
194 KyUInt32 GetActiveDatabaseChangeIdx()
const {
return m_activeChangeIdx.m_anyChangeIdx; }
197 friend class DatabaseUpdateManager;
198 friend class NavMeshElementManager;
200 void IncrementNavDataChangeIndex();
203 void TakeSnapShotOfNavDataAddRemoveToUpdate();
204 void ClearSnapShotOfNavDataAddRemoveToUpdate();
206 bool AreNavGraphsBeeingAdded();
207 void RemoveNavGraphsOfNavDataBeeingRemoved();
208 void AddNavGraphsOfNavDataBeeingAdded();
210 bool AreAbstractGraphBeeingAdded();
211 void StartAbstractGraphInsertionOfNavDataBeeingAdded();
212 void InsertAbstractGraphOfNavDataBeeingAdded();
213 void RemoveAbstractGraphOfNavDataBeeingRemoved();
215 void StartNavMeshInsertionOfNavDataBeeingAdded();
216 void StartNavMeshRemovalOfNavDataBeeingRemoved();
217 void RemoveNavMeshOfNavDataBeeingRemoved();
219 void ComputeCellNextActivenessStatus(QueryProcessMode queryProcessMode);
220 void UpdateStitchOneToOneAndLaunchRuntimeStitchQueries(QueryProcessMode queryProcessMode);
222 void ForceSendAllDynamicFloorsAtCellPos(VisualDebugServer &visualDebugServer);
224 void FinalizeChange();
226 enum CompatibilityStatus
228 Compatibility_Untested,
230 Compatibility_Success,
232 CompatibilityStatus
IsCompatibleWith(
const NavData& navData,
const TrackedCollection<Ptr<NavData>, MemStat_WorldFwk>& navDataCollection)
const;
237 DatabasePositionSpatializationRange m_positionSpatializationRange;
244 AbstractGraphCellGrid* m_abstractGraphCellGrid;
245 WorkingMemory* m_workingMemory;
257 Ptr<IDatabaseChangeBroadcaster> m_eventBroadCaster;
259 DatabaseGeometryBuildingManager m_geometryBuildingManager;
264 PerformQueryStatistics* m_queryStatistics;
269 DatabaseChangeInProgress m_changeInProgress;
270 DatabaseChangeIdx m_activeChangeIdx;
271 DatabaseChange m_lastChange;
277 static const KyUInt32 marginValues[RayCanGoMarginModeCount] = {
286 return marginValues[rayCanGoMarginMode];
void RemoveAllNavDataImmediate()
Remove all the NavData from this Database.
Definition: database.cpp:581
Margin to be used when computing the DiagonalStrip used for Channel computation.
Definition: database.h:40
void SetVisualGeometryFactory(Ptr< IVisualGeometryFactory > factory)
If a IVisualGeometryFactory is provided with SetVisualGeometryFactory(), the database will use a grid...
Definition: database.h:143
NavCellGrid * m_navCellGrid
bookkeeping, stitching, spatialization, NavCells version management, ...
Definition: database.h:241
Collection< Ptr< BaseBlobHandler > > m_visualDebugBlobCollection
(VisualDebug) store the blob to be send during the DoSendVisualDebug call.
Definition: database.h:262
Game side: Manages all DisplayListData, send them to the NavigationLab.
Definition: displaylist.h:375
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:31
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
bool m_needToSendActiveNavData
(VisualDebug) Avoids sending all the active NavData each frame. Accessed by the NavCellGrid.
Definition: database.h:261
bool IsClear() const
Returns true if the Database is not associated to any set of generation parameters.
Definition: database.h:86
PerformQueryStatistics * GetPerformQueryStatistics()
Return statistics on queries called on this Database.
Definition: database.h:129
This class gathers all the navigation data that are currently active in a Database.
Definition: activedata.h:22
Collection is a class which is a "Collection" of elements (not sorted, not unique) ...
Definition: collection.h:31
KyUInt32 GetDatabaseIndex() const
Retrieves the index of the Database in the array of Databases maintained by the World.
Definition: database.h:70
DatabaseGeometryBuildingManager & GetDatabaseGeometryBuildingManager()
Retrieves the instance of the DatabaseGeometryBuildingManager maintained by this object, which manage the tiling of DatabaseVisualGeometryBuilder.
Definition: database.h:160
ActiveData * m_activeData
all the data that are active
Definition: database.h:240
IVisualGeometryFactory is an abstract base class for an object that accepts that can instantiate obje...
Definition: ivisualgeometry.h:105
TrackedCollection is a class which is a "Collection" of T=C* or T = Ptr< c="" /> (not sorted...
Definition: collection.h:77
DatabaseGenMetrics m_generationMetrics
generation parameters. Set by the NavMeshElementManager. Do Not Modify
Definition: database.h:238
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
Margin to be used in any path computation ray can go queries to ensure the computed Path is not too c...
Definition: database.h:42
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
NavGraphManager * m_navGraphManager
NavGraph container.
Definition: database.h:243
DisplayListManager * GetDisplayListManager() const
Get the DisplayListManager that is required when creating a DisplayList.
Definition: database.cpp:95
Margin to be used in MoveOnNavMesh or any other actual movement computation.
Definition: database.h:45
The NavData class is the object containing navigation data that will be added to one Database...
Definition: navdata.h:39
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
VisualDebugServer * GetVisualDebugServer() const
Get the VisualDebugServer.
Definition: database.cpp:100
RayCanGoMarginMode
Defines the different mode for the NavMesh border margin to be used in RayCanGo queries.
Definition: database.h:37
Navigation return code class.
Definition: types.h:108
WorldElementType
Enumerates the WorldElement types.
Definition: worldelementtype.h:13
Base internal class used to represent elements that can be added to a World, such as instances of Dat...
Definition: worldelement.h:41
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Margin to be used to get ray can go exactly on the NavMesh borders.
Definition: database.h:39
WorkingMemory * GetWorkingMemory() const
The WorkingMemory used by default by Queries when processed outside a QueryQueue. You should not need...
Definition: database.h:104
IVisualGeometry * GetVisualGeometry() const
Retrieves the instance of IVisualGeometry to which this object sends its triangles for rendering set ...
Definition: database.h:164
KyFloat32 m_integerPrecision
For internal use. Do not modify.
Definition: databasegenmetrics.h:134
const DatabaseGenMetrics & GetDatabaseGenMetrics() const
Retrieves the DatabaseGenMetrics, which offers services for converting between floating-point coordin...
Definition: database.h:74
Margin to be used in any path following ray can go queries to ensure the computed trajectory is not t...
Definition: database.h:43
void SetVisualGeometry(Ptr< IVisualGeometry > geometry)
Sets the instance of IVisualGeometry to which this object will send its triangles for rendering when ...
Definition: database.h:147
void Clear()
internal, use World::ClearDatabase(KyUInt32 databaseIndex). RemoveAll navData, bots, clear memory of cell grid, activeData and GenerationMetrics
Definition: database.cpp:74
NavMeshElementManager * m_navMeshElementManager
NavMesh container + GUID manager/sorter.
Definition: database.h:242
bool IsCompatibleWith(const NavData &navData) const
Indicates whether or not the specified NavData object was created with the same generation parameters...
Definition: database.cpp:540
Margin to be used for Channel computation.
Definition: database.h:41
Margin to be used only to reevaluate a trajectory previously validated with can go using IdealTraject...
Definition: database.h:44
This class is a runtime container for the all NavMeshElement that are created from the NavMeshElement...
Definition: navmeshelementmanager.h:23
This class gathers a set of generation parameters of one Database and manages the conversion between ...
Definition: databasegenmetrics.h:22
float KyFloat32
float
Definition: types.h:32
This class is an internal class used to manage all the NavCell in a grid.
Definition: navcellgrid.h:60
void BuildVisualGeometry(bool forceRebuildAll=false)
Sends to the IVisualGeometry or to the IVisualGeometry of the DatabaseGeometryBuildingManager (depend...
Definition: database.h:151
IVisualGeometry is an abstract base class that displays Triangles, Lines, and Texts.
Definition: ivisualgeometry.h:76