Kaim::World Class Reference
#include <world.h>
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
- performance/Tutorial_MultiThreading.cpp, performance/Tutorial_MultiThreading_5_worlds.cpp, performance/Tutorial_NoTimeSlicing.cpp, performance/Tutorial_TimeSlicing.cpp, Tutorial_AvoidanceFilter.cpp, Tutorial_FirstIntegration.cpp, Tutorial_Generation_Navdata_FromMem.cpp, Tutorial_Generation_postProcess.cpp, Tutorial_NavMeshTraversal.cpp, Tutorial_NavTag.cpp, Tutorial_ObstacleIntegration.cpp, Tutorial_Obstacles.cpp, Tutorial_PointOfInterest.cpp, Tutorial_QueryQueue.cpp, Tutorial_SplineFollow.cpp, Tutorial_TrackingMemoryLeak.cpp, Tutorial_VisualDebug.cpp, Tutorial_VisualGeometry.cpp, and Tutorial_WorldInit.cpp.
Inherits Kaim::RefCountBaseNTS< C, Stat >.
|
| World (KyUInt32 databaseCount=1) |
|
virtual | ~World () |
|
void | SetUserData (void *userData) |
|
void * | GetUserData () |
|
|
Returns statistics on CPU consumption during Update() and its steps.
With KY_CONFIG_RELEASE, it returns nullptr;
|
KyResult | StartVisualDebug (const VisualDebugServerConfig &visualDebugServerConfig) |
| VisualDebugging is only enabled with KY_CONFIG_DEBUG and KY_CONFIG_DEV With KY_CONFIG_RELEASE, functions related to VisualDebugging are replaced by empty inlined functions for convenience, However, it can still be judicious to guard your own code that uses VisualDebugging with a check against KY_CONFIG_RELEASE. More...
|
|
void | StopVisualDebug () |
|
void | NewVisualDebugFrame (KyUInt32 gameFrameIndex=0xFFFFFFFF) |
|
VisualDebugServer * | GetVisualDebugServer () |
|
VisualDebugRegistry * | GetElementRegistry () |
| Returns the registry in this World of instances of WorldElement that can be visually debugged in the Navigation Lab. More...
|
|
DisplayListManager * | GetDisplayListManager () |
| Get the DisplayListManager that is required when creating a DisplayList. More...
|
|
VisualDebugAttributesManager * | GetAttributesManager () |
| Get the attributesManager that is required when creating an attribute group. More...
|
|
|
void | RemoveAndCancellAll () |
| Remove all Bots, PointOfInterest, CylinderObstacles, BoxObstacles, TagVolumes, and NavData; and cancel all queries. More...
|
|
void | RemoveAllBots () |
|
void | RemoveAllPointsOfInterest () |
|
void | RemoveAllCylinderObstacles () |
|
void | RemoveAllBoxObstacles () |
|
void | RemoveAllTagVolumes () |
|
void | ClearDatabase (KyUInt32 databaseIndex) |
|
Kaim::World::World |
( |
KyUInt32 |
databaseCount = 1 | ) |
|
|
explicit |
- Parameters
-
databaseCount | The number of databases added to this world, must be greater than or equal to 1. |
void Kaim::World::CancelAsyncQuery |
( |
IQuery * |
query | ) |
|
This function should be called only for queries currently in a query queue which can be checked by calling query->IsInAQueryQueue().
void Kaim::World::ForceClearWorkingMemory |
( |
| ) |
|
Cancel all queries and only free WorkingMemory for all databases and query queues owned by this world.
Be sure that all of your object relying on command not processed yet handle cancellation properly (cf QueryProcessStatus::QueryCanceled) . Fully processed queries will get their IOnDone::OnDone called.
VisualDebugAttributesManager * Kaim::World::GetAttributesManager |
( |
| ) |
|
|
inline |
Get the attributesManager that is required when creating an attribute group.
- Precondition
- index must be valid, we don't check it there.
- Precondition
- index must be valid, we don't check it there.
- Precondition
- index must be valid, we don't check it there.
VisualDebugRegistry * Kaim::World::GetElementRegistry |
( |
| ) |
|
|
inline |
Returns the registry in this World of instances of WorldElement that can be visually debugged in the Navigation Lab.
KyUInt32 Kaim::World::GetNumberOfFramesForShortcutTrajectoryPeriodicUpdate |
( |
| ) |
const |
|
inline |
Theses functions are only useful for bots with ShortcutTrajectory.
It allows to skip ProgressOnPath and ShortcutTrajectory computations that are usually done each frame. Note that on some events the bot can be updated more often than the given number. For instance, if changes occur on the Path or to be sure not to miss its current target. Gives the number of frames between two updates of the PathFollowing for each bot.
- Precondition
- index must be valid, we don't check it there.
- Precondition
- index must be valid, we don't check it there.
- Precondition
- index must be valid, we don't check it there.
- Precondition
- index must be valid, we don't check it there.
- Precondition
- index must be valid, we don't check it there.
KyUInt32 Kaim::World::GetUpdateCount |
( |
| ) |
const |
|
inline |
Retrieves the number of times Update() has been called.
void Kaim::World::PushAsyncQuery |
( |
IQuery * |
query, |
|
|
AsyncQueryDispatchId |
asyncQueryDispatchId = AsyncQueryDispatchId_Default , |
|
|
Bot * |
bot = nullptr |
|
) |
| |
void Kaim::World::RemoveAndCancellAll |
( |
| ) |
|
Remove all Bots, PointOfInterest, CylinderObstacles, BoxObstacles, TagVolumes, and NavData; and cancel all queries.
void Kaim::World::SetNumberOfFramesForShortcutTrajectoryPeriodicUpdate |
( |
KyUInt32 |
numberOfFrames | ) |
|
|
inline |
Set the number of frames between two updates of the PathFollowing for all bots with TrajectoryMode_Shortcut.
Default value is 1 in order to get an update each frame. If 0 is passed, it is defaulted to 1. For instance, by setting a value of 5, UpdateBotPathFollowing will call the ProgressOnPathComputer and the Trajectory one frame on 5, this will make UpdateBotPathFollowing being around 3 times faster since the number of RayCanGo used to maintained the TargetOnPathStatus is exactly divided by 5, but some other components are already skipping some frames, hence their cost is not divided by 5.
VisualDebugging is only enabled with KY_CONFIG_DEBUG and KY_CONFIG_DEV With KY_CONFIG_RELEASE, functions related to VisualDebugging are replaced by empty inlined functions for convenience, However, it can still be judicious to guard your own code that uses VisualDebugging with a check against KY_CONFIG_RELEASE.
Starts the visual debug server. You can start it at any time.
void Kaim::World::Update |
( |
KyFloat32 |
simulationTimeInSeconds = 0.016f | ) |
|
Updates the World.
It is possible to use Autodesk Navigation as a NavMesh/NavGraph Query toolbox without calling World::Update(). But to easily support Bots, obstacles, DynamicNavMesh, etc., a World::Update() call is required every frame.
The documentation for this class was generated from the following files:
- gwnavruntime/world/world.h
- gwnavruntime/world/world.cpp