#include <AIManager.h>
|
| AIManager (Scene &parentScene, TaskPool &pool) |
|
| ~AIManager () |
|
void | destroy () |
| Clear all AI related data (teams, entities, NavMeshes, etc);.
|
|
void | update (U64 deltaTimeUS) |
| Called at a fixed interval (preferably in a separate thread);.
|
|
bool | registerEntity (U32 teamID, AIEntity *entity) |
|
void | unregisterEntity (U32 teamID, AIEntity *entity) |
|
void | unregisterEntity (AIEntity *entity) |
|
AITeam * | getTeamByID (const U32 AITeamID) |
|
Navigation::NavigationMesh * | addNavMesh (PlatformContext &context, Navigation::DivideRecast &recastInterface, Scene &parentScene, AIEntity::PresetAgentRadius radius) |
| Add a NavMesh.
|
|
bool | destroyNavMesh (AIEntity::PresetAgentRadius radius) |
|
Navigation::NavigationMesh * | getNavMesh (const AIEntity::PresetAgentRadius radius) const |
|
void | setSceneCallback (const DELEGATE< void > &callback) |
| Remove a NavMesh.
|
|
void | pauseUpdate (const bool state) noexcept |
|
bool | updatePaused () const noexcept |
|
bool | updating () const noexcept |
|
void | debugDraw (GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut, bool forceAll=true) |
|
bool | isDebugDraw () const noexcept |
|
void | toggleNavMeshDebugDraw (bool state) |
| Toggle debug draw for all NavMeshes.
|
|
bool | navMeshDebugDraw () const noexcept |
|
void | stop () noexcept |
|
bool | running () const noexcept |
|
AITeam * | registerTeam (U32 id) |
| Register an AI Team.
|
|
bool | unregisterTeam (U32 id) |
| Unregister an AI Team.
|
|
| SceneComponent (Scene &parentScene) noexcept |
|
Scene & | parentScene () noexcept |
|
const Scene & | parentScene () const noexcept |
|
Definition at line 57 of file AIManager.h.
◆ AITeamMap
◆ NavMeshMap
◆ AIManager()
Divide::AIManager::AIManager |
( |
Scene & |
parentScene, |
|
|
TaskPool & |
pool |
|
) |
| |
|
explicit |
◆ ~AIManager()
Divide::AIManager::~AIManager |
( |
| ) |
|
◆ addNavMesh()
◆ debugDraw()
Handle any debug information rendering (nav meshes, AI paths, etc). Called by Scene::postRender after depth map preview call
Definition at line 212 of file AIManager.cpp.
◆ destroy()
void Divide::AIManager::destroy |
( |
| ) |
|
Clear all AI related data (teams, entities, NavMeshes, etc);.
Clear up any remaining AIEntities.
Definition at line 34 of file AIManager.cpp.
◆ destroyNavMesh()
◆ getNavMesh()
◆ getTeamByID()
AITeam * Divide::AI::AIManager::getTeamByID |
( |
const U32 |
AITeamID | ) |
|
|
inline |
◆ isDebugDraw()
bool Divide::AI::AIManager::isDebugDraw |
( |
| ) |
const |
|
inlinenoexcept |
◆ navMeshDebugDraw()
bool Divide::AI::AIManager::navMeshDebugDraw |
( |
| ) |
const |
|
inlinenoexcept |
◆ pauseUpdate()
void Divide::AI::AIManager::pauseUpdate |
( |
const bool |
state | ) |
|
|
inlinenoexcept |
◆ processData()
bool Divide::AIManager::processData |
( |
U64 |
deltaTimeUS | ) |
|
|
private |
◆ processInput()
bool Divide::AIManager::processInput |
( |
U64 |
deltaTimeUS | ) |
|
|
private |
◆ registerEntity()
bool Divide::AIManager::registerEntity |
( |
U32 |
teamID, |
|
|
AIEntity * |
entity |
|
) |
| |
Add an AI Entity to a specific team. Entities can be added to multiple teams. Caller is responsible for the lifetime of entity
Definition at line 105 of file AIManager.cpp.
◆ registerTeam()
AITeam * Divide::AIManager::registerTeam |
( |
U32 |
id | ) |
|
◆ running()
bool Divide::AI::AIManager::running |
( |
| ) |
const |
|
inlinenoexcept |
◆ setSceneCallback()
void Divide::AI::AIManager::setSceneCallback |
( |
const DELEGATE< void > & |
callback | ) |
|
|
inline |
◆ shouldStop()
bool Divide::AIManager::shouldStop |
( |
| ) |
const |
|
protectednoexcept |
◆ stop()
void Divide::AI::AIManager::stop |
( |
| ) |
|
|
inlinenoexcept |
◆ toggleNavMeshDebugDraw()
void Divide::AIManager::toggleNavMeshDebugDraw |
( |
bool |
state | ) |
|
Toggle debug draw for all NavMeshes.
Definition at line 203 of file AIManager.cpp.
◆ unregisterEntity() [1/2]
void Divide::AIManager::unregisterEntity |
( |
AIEntity * |
entity | ) |
|
Remove an AI Entity from all teams. Entities can be added to multiple teams. Caller is responsible for the lifetime of entity
Definition at line 115 of file AIManager.cpp.
◆ unregisterEntity() [2/2]
void Divide::AIManager::unregisterEntity |
( |
U32 |
teamID, |
|
|
AIEntity * |
entity |
|
) |
| |
Remove an AI Entity from a specific teams. Entities can be added to multiple teams. Caller is responsible for the lifetime of entity
Definition at line 121 of file AIManager.cpp.
◆ unregisterTeam()
bool Divide::AIManager::unregisterTeam |
( |
U32 |
id | ) |
|
◆ update()
void Divide::AIManager::update |
( |
U64 |
deltaTimeUS | ) |
|
Called at a fixed interval (preferably in a separate thread);.
use internal delta time calculations
Lock the entities during update() adding or deleting entities is suspended until this returns
Definition at line 46 of file AIManager.cpp.
◆ updateEntities()
bool Divide::AIManager::updateEntities |
( |
U64 |
deltaTimeUS | ) |
|
|
private |
◆ updatePaused()
bool Divide::AI::AIManager::updatePaused |
( |
| ) |
const |
|
inlinenoexcept |
◆ updating()
bool Divide::AI::AIManager::updating |
( |
| ) |
const |
|
inlinenoexcept |
◆ AITeam
◆ _aiTeams
◆ _currentTimeUS
U64 Divide::AI::AIManager::_currentTimeUS |
|
private |
◆ _deltaTimeUS
U64 Divide::AI::AIManager::_deltaTimeUS |
|
private |
◆ _navMeshDebugDraw
std::atomic_bool Divide::AI::AIManager::_navMeshDebugDraw |
|
private |
◆ _navMeshes
◆ _navMeshMutex
◆ _parentPool
TaskPool& Divide::AI::AIManager::_parentPool |
|
private |
◆ _pauseUpdate
std::atomic_bool Divide::AI::AIManager::_pauseUpdate |
|
private |
◆ _previousTimeUS
U64 Divide::AI::AIManager::_previousTimeUS |
|
private |
◆ _running
std::atomic_bool Divide::AI::AIManager::_running |
|
private |
◆ _sceneCallback
DELEGATE<void> Divide::AI::AIManager::_sceneCallback |
|
private |
◆ _shouldStop
std::atomic_bool Divide::AI::AIManager::_shouldStop |
|
private |
◆ _updateMutex
Mutex Divide::AI::AIManager::_updateMutex |
|
mutableprivate |
◆ _updating
std::atomic_bool Divide::AI::AIManager::_updating |
|
private |
The documentation for this class was generated from the following files: