9 #ifndef Navigation_World_H
10 #define Navigation_World_H
33 class DatabaseBinding;
34 class WorldElementSpatializer;
35 class PointOfInterest;
36 class CylinderObstacle;
43 class IAvoidanceComputer;
44 class QueryQueueArray;
46 class AsyncQueryDispatcher;
47 class DatabaseUpdateManager;
48 class VisualDebugAttributesManager;
49 class BaseNavigationProfile;
54 class World :
public RefCountBaseNTS<World, MemStat_WorldFwk>
65 void SetUserData(
void* userData);
91 void StopVisualDebug();
111 KyUInt32 GetPointsOfInterestCount()
const;
114 KyUInt32 GetCylinderObstaclesCount()
const;
117 KyUInt32 GetBoxObstaclesCount()
const;
120 KyUInt32 GetTagVolumesCount()
const;
121 KyUInt32 GetTagVolumesToBeIntegratedCount()
const;
122 KyUInt32 GetTagVolumesIntegratedCount()
const;
123 KyUInt32 GetTagVolumesToBeRemovedCount()
const;
128 KyUInt32 GetQueryQueueArraysCount()
const;
131 KyUInt32 GetQueryPendingOperationCount()
const;
138 Ptr<BaseNavigationProfile> GetNavigationProfile(
KyUInt32 profileId);
159 void ProcessQueuesOutsideWorldUpdate();
161 void SetWorldUpdateThreadId(ThreadId threadId);
162 ThreadId GetWorldUpdateThreadId()
const;
170 void RemoveAllBots();
171 void RemoveAllPointsOfInterest();
172 void RemoveAllCylinderObstacles();
173 void RemoveAllBoxObstacles();
174 void RemoveAllTagVolumes();
177 void ClearDatabase(
KyUInt32 databaseIndex);
206 void FlushCommandsInWorldUpdate();
207 void ProcessQueuesInWorldUpdate();
209 void UpdateDatabases();
210 void UpdateSpatializations();
211 void UpdateBotsPathFollowing(
KyFloat32 simulationTimeInSeconds);
212 void SendVisualDebugData(
KyFloat32 simulationTimeInSeconds);
213 void UpdateStatistics(
KyFloat32 worldUpdateMs);
214 void FlushCommandsOutOfWorldUpdate();
217 void CancelAllQueriesAndClearCommandsInAllQueryQueueArray();
218 void ClearAllDatabases();
228 KyUInt32 m_nbFramesForShortcutTrajectoryPeriodicUpdate;
233 Ptr<DatabaseBinding> m_allDatabaseBinding;
236 Ptr<CollisionWorld> m_collisionWorld;
250 WorldElementSpatializer* m_worldElementSpatializer;
253 Ptr<BaseNavigationProfile> m_defaultNavigationProfile;
254 Ptr<BotConfig> m_defaultPathFollowerConfig;
261 VisualDebugRegistry* m_visualDebugRegistry;
262 VisualDebugAttributesManager* m_visualDebugAttributesManager;
265 WorldStatistics* m_statistics;
267 DatabaseUpdateManager* m_databaseUpdateManager;
273 Ptr<IAsyncQueryDispatcher> m_asyncQueryDispatcher;
274 bool m_isInWorldUpdate;
275 ThreadId m_worldUpdateThreadId;
278 KY_INLINE
void World::SetUserData(
void* userData) { m_userData = userData; }
279 KY_INLINE
void* World::GetUserData() {
return m_userData; }
284 KY_INLINE
KyUInt32 World::GetDatabasesCount()
const {
return m_databases.GetCount(); }
287 KY_INLINE
KyUInt32 World::GetPointsOfInterestCount()
const {
return m_pointsOfInterests.GetCount(); }
290 KY_INLINE
KyUInt32 World::GetCylinderObstaclesCount()
const {
return m_cylinderObstacles.GetCount(); }
293 KY_INLINE
KyUInt32 World::GetBoxObstaclesCount()
const {
return m_boxObstacles.GetCount(); }
296 KY_INLINE
KyUInt32 World::GetTagVolumesCount()
const
298 return m_tagVolumesToBeIntegrated.GetCount() + m_tagVolumesIntegrated.GetCount() + m_tagVolumesToBeRemoved.GetCount();
300 KY_INLINE
KyUInt32 World::GetTagVolumesToBeIntegratedCount()
const {
return m_tagVolumesToBeIntegrated.GetCount(); }
301 KY_INLINE
KyUInt32 World::GetTagVolumesIntegratedCount()
const {
return m_tagVolumesIntegrated.GetCount(); }
302 KY_INLINE
KyUInt32 World::GetTagVolumesToBeRemovedCount()
const {
return m_tagVolumesToBeRemoved.GetCount(); }
307 KY_INLINE
KyUInt32 World::GetQueryQueueArraysCount()
const {
return m_queryQueueArrays.GetCount(); }
310 KY_INLINE IAsyncQueryDispatcher* World::GetAsyncQueryDispatcher() {
return m_asyncQueryDispatcher; }
312 KY_INLINE
void World::SetWorldUpdateThreadId(ThreadId threadId) { m_worldUpdateThreadId = threadId; }
313 KY_INLINE ThreadId World::GetWorldUpdateThreadId()
const {
return m_worldUpdateThreadId; }
318 KY_INLINE VisualDebugServer* World::GetVisualDebugServer() {
return m_visualDebugServer; }
323 #ifdef KY_BUILD_SHIPPING
325 KY_INLINE
void World::StopVisualDebug() {}
330 #endif //Navigation_World_H
AvoidanceWorkspace aggregates at once:
Definition: avoidanceworkspace.h:38
void RemoveAndCancellAll()
Remove all Bots, PointOfInterest, CylinderObstacles, BoxObstacles, TagVolumes, and NavData; and cance...
CylinderObstacles represent dynamic objects of your game engine that prevent your Bots from moving fr...
Definition: cylinderobstacle.h:87
This class is the world element that represent an active character in Gameware Navigation.
Definition: bot.h:150
World(KyUInt32 databaseCount=1)
AsyncQueryDispatchId
Typically there is one QueryQueue for each AsyncQueryDispatchId.
Definition: asyncquerydispatcher.h:23
KyUInt32 AddNavigationProfile(Ptr< BaseNavigationProfile > navigationProfile)
If TraverseLogic of the NavigationProfile has obsolete functions, navigationProfile won't be added an...
Game side: Manages all DisplayListData, send them to the NavigationLab.
Definition: displaylist.h:409
KyUInt32 GetUpdateCount() const
Retrieves the number of times Update() has been called.
Definition: world.h:333
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Database * GetDatabase(KyUInt32 index)
Definition: world.h:337
void SetNumberOfFramesForShortcutTrajectoryPeriodicUpdate(KyUInt32 numberOfFrames)
Set the number of frames between two updates of the PathFollowing for all bots with TrajectoryMode_Sh...
Definition: world.h:368
QueryQueueArray * GetQueryQueueArray(KyUInt32 index)
Definition: world.h:360
QueryQueueArray processes queries in an asynchronous, time-sliced way.
Definition: queryqueuearray.h:38
TagVolume * GetTagVolumesToBeRemoved(KyUInt32 index)
Definition: world.h:357
VisualDebugAttributesManager * GetAttributesManager()
Get the attributesManager that is required when creating an attribute group.
Definition: world.h:373
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
#define KY_NULL
Null value.
Definition: types.h:247
TrackedCollection is a class which is a "Collection" of T=C* or T = Ptr< c="" /> (not sorted...
Definition: collection.h:87
KyResult StartVisualDebug(const VisualDebugServerConfig &visualDebugServerConfig)
Starts the visual debug server. You can start it at any time.
void SetAsyncQueryDispatcher(IAsyncQueryDispatcher *asyncQueryDispatcher)
Set a new IAsyncQueryDispatcher instance to be used by this World:
void Update(KyFloat32 simulationTimeInSeconds=0.016f)
Updates the World.
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
TagVolume * GetTagVolumesToBeIntegrated(KyUInt32 index)
Definition: world.h:355
This class represents runtime-defined volumes with customized NavTag.
Definition: tagvolume.h:108
Configure the VisualDebugServer.
Definition: visualdebugserver.h:48
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
void ForceClearWorkingMemory()
Cancel all queries and only free WorkingMemory for all databases and query queues owned by this world...
BoxObstacle * GetBoxObstacle(KyUInt32 index)
Definition: world.h:346
Definition: gamekitcrowddispersion.h:20
#define KY_ERROR
Shorthand for Kaim::Result::Failure.
Definition: types.h:272
The VisualDebugServer manages the sending of data to clients.
Definition: visualdebugserver.h:254
void PushAsyncQuery(IQuery *query, AsyncQueryDispatchId asyncQueryDispatchId=AsyncQueryDispatchId_Default, Bot *bot=0)
Pushes an IQuery in the right QueryQueue accordingly to World's IAsyncQueryDispatcher.
PointOfInterest * GetPointOfInterest(KyUInt32 index)
Definition: world.h:340
World::PushAsyncQuery(IQuery* query) pushes the Query in the QueryQueue.
Definition: asyncquerydispatcher.h:44
KyUInt32 GetNumberOfFramesForShortcutTrajectoryPeriodicUpdate() const
Gives the number of frames between two updates of the PathFollowing for each bot. ...
Definition: world.h:367
PointOfInterest is a tagged position spatialized into the NavMesh.
Definition: pointofinterest.h:86
DisplayListManager * GetDisplayListManager()
Get the DisplayListManager that is required when creating a ScopedDisplayList.
Definition: world.h:372
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
WorldStatistics * GetWorldStatistics()
Returns statistics on CPU consumption during Update() and its steps.
Definition: world.h:334
void CancelAsyncQuery(IQuery *query)
This function should be called only for queries currently in a query queue which can be checked by ca...
Each instance of the BoxObstacle class represents a dynamic, physical object in your game engine that...
Definition: boxobstacle.h:139
VisualDebugRegistry * GetElementRegistry()
Returns the registry in this World of instances of WorldElement that can be visually debugged in Game...
Definition: world.h:371
TagVolume * GetTagVolumesIntegrated(KyUInt32 index)
Definition: world.h:356
CylinderObstacle * GetCylinderObstacle(KyUInt32 index)
Definition: world.h:343
Abstract class for all queries.
Definition: iquery.h:133
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43