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);
156 void CancelAsyncQuery(
IQuery* query);
158 void ProcessQueuesOutsideWorldUpdate();
160 void SetWorldUpdateThreadId(ThreadId threadId);
161 ThreadId GetWorldUpdateThreadId()
const;
170 void RemoveAllBots();
171 void RemoveAllPointsOfInterest();
172 void RemoveAllCylinderObstacles();
173 void RemoveAllBoxObstacles();
174 void RemoveAllTagVolumes();
177 void ClearDatabase(
KyUInt32 databaseIndex);
199 void FlushCommandsInWorldUpdate();
200 void ProcessQueuesInWorldUpdate();
202 void UpdateDatabases();
203 void UpdateSpatializations();
204 void UpdateBotsPathFollowing(
KyFloat32 simulationTimeInSeconds);
205 void SendVisualDebugData(
KyFloat32 simulationTimeInSeconds);
206 void UpdateStatistics(
KyFloat32 worldUpdateMs);
207 void FlushCommandsOutOfWorldUpdate();
210 void CancelAllQueriesAndClearCommandsInAllQueryQueueArray();
211 void ClearAllDatabases();
221 KyUInt32 m_nbFramesForShortcutTrajectoryPeriodicUpdate;
226 Ptr<DatabaseBinding> m_allDatabaseBinding;
229 Ptr<CollisionWorld> m_collisionWorld;
243 WorldElementSpatializer* m_worldElementSpatializer;
246 Ptr<BaseNavigationProfile> m_defaultNavigationProfile;
247 Ptr<BotConfig> m_defaultPathFollowerConfig;
254 VisualDebugRegistry* m_visualDebugRegistry;
255 VisualDebugAttributesManager* m_visualDebugAttributesManager;
258 WorldStatistics* m_statistics;
260 DatabaseUpdateManager* m_databaseUpdateManager;
266 Ptr<IAsyncQueryDispatcher> m_asyncQueryDispatcher;
267 bool m_isInWorldUpdate;
268 ThreadId m_worldUpdateThreadId;
271 KY_INLINE
void World::SetUserData(
void* userData) { m_userData = userData; }
272 KY_INLINE
void* World::GetUserData() {
return m_userData; }
277 KY_INLINE
KyUInt32 World::GetDatabasesCount()
const {
return m_databases.GetCount(); }
280 KY_INLINE
KyUInt32 World::GetPointsOfInterestCount()
const {
return m_pointsOfInterests.GetCount(); }
283 KY_INLINE
KyUInt32 World::GetCylinderObstaclesCount()
const {
return m_cylinderObstacles.GetCount(); }
286 KY_INLINE
KyUInt32 World::GetBoxObstaclesCount()
const {
return m_boxObstacles.GetCount(); }
289 KY_INLINE
KyUInt32 World::GetTagVolumesCount()
const
291 return m_tagVolumesToBeIntegrated.GetCount() + m_tagVolumesIntegrated.GetCount() + m_tagVolumesToBeRemoved.GetCount();
293 KY_INLINE
KyUInt32 World::GetTagVolumesToBeIntegratedCount()
const {
return m_tagVolumesToBeIntegrated.GetCount(); }
294 KY_INLINE
KyUInt32 World::GetTagVolumesIntegratedCount()
const {
return m_tagVolumesIntegrated.GetCount(); }
295 KY_INLINE
KyUInt32 World::GetTagVolumesToBeRemovedCount()
const {
return m_tagVolumesToBeRemoved.GetCount(); }
300 KY_INLINE
KyUInt32 World::GetQueryQueueArraysCount()
const {
return m_queryQueueArrays.GetCount(); }
303 KY_INLINE IAsyncQueryDispatcher* World::GetAsyncQueryDispatcher() {
return m_asyncQueryDispatcher; }
305 KY_INLINE
void World::SetWorldUpdateThreadId(ThreadId threadId) { m_worldUpdateThreadId = threadId; }
306 KY_INLINE ThreadId World::GetWorldUpdateThreadId()
const {
return m_worldUpdateThreadId; }
311 KY_INLINE VisualDebugServer* World::GetVisualDebugServer() {
return m_visualDebugServer; }
316 #ifdef KY_BUILD_SHIPPING
318 KY_INLINE
void World::StopVisualDebug() {}
323 #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:320
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:324
void SetNumberOfFramesForShortcutTrajectoryPeriodicUpdate(KyUInt32 numberOfFrames)
Set the number of frames between two updates of the PathFollowing for all bots with TrajectoryMode_Sh...
Definition: world.h:355
QueryQueueArray * GetQueryQueueArray(KyUInt32 index)
Definition: world.h:347
QueryQueueArray processes queries in an asynchronous, time-sliced way.
Definition: queryqueuearray.h:38
TagVolume * GetTagVolumesToBeRemoved(KyUInt32 index)
Definition: world.h:344
VisualDebugAttributesManager * GetAttributesManager()
Get the attributesManager that is required when creating an attribute group.
Definition: world.h:360
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:342
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
BoxObstacle * GetBoxObstacle(KyUInt32 index)
Definition: world.h:333
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:327
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:354
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:359
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:321
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:358
TagVolume * GetTagVolumesIntegrated(KyUInt32 index)
Definition: world.h:343
CylinderObstacle * GetCylinderObstacle(KyUInt32 index)
Definition: world.h:330
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