Nebula
Loading...
Searching...
No Matches
agentmanager.cc File Reference
#include "application/stdneb.h"
#include "agentmanager.h"
#include "navigationmanager.h"
#include "components/navigation.h"
#include "navigationfeature/navquery.h"
#include "basegamefeature/components/position.h"
#include "basegamefeature/components/orientation.h"
#include "basegamefeature/components/velocity.h"
#include "game/timesource.h"
#include "basegamefeature/managers/timemanager.h"
#include "dynui/im3d/im3dcontext.h"
#include "DetourCrowd.h"
#include "DetourNavMesh.h"
#include "DetourNavMeshQuery.h"
#include "DetourCommon.h"
#include "DetourPathQueue.h"
#include "profiling/profiling.h"
#include "jobs2/jobs2.h"

Classes

struct  NavigationFeature::AgentManager::CrowdRecord
struct  NavigationFeature::AgentManager::AgentRecord
struct  NavigationFeature::AgentAccess
 what the feature unit's debug draw and the free functions reach into More...

Namespaces

namespace  Navigation
 Navigation::Build geometry sources.
namespace  NavigationFeature
 Queries on a loaded navmesh.

Functions

 NavigationFeature::__ImplementClass (NavigationFeature::AgentManager, 'NvAg', Game::Manager)
 NavigationFeature::__ImplementSingleton (AgentManager) static const expr int MinCrowdAgents
 the fewest agents a crowd is made for.
static AgentManager::AgentRecord * NavigationFeature::FindAgent (Game::World *world, Game::Entity entity)
static void NavigationFeature::LeaveCrowd (AgentManager::AgentRecord *agent)
static void NavigationFeature::FreeCrowd (IndexT crowdIndex)
 The agents of the crowd join again when its navmesh is back.
static bool NavigationFeature::CrowdIsCurrent (const AgentManager::CrowdRecord *crowd)
 A crowd is stale when its navmesh was unloaded or reloaded, the crowd points into the old one.
static AgentManager::CrowdRecord * NavigationFeature::GetCrowd (Game::World *world, Navigation::NavMeshId navMesh)
static bool NavigationFeature::JoinCrowd (AgentManager::AgentRecord *agent, const NavAgent &component)
static void NavigationFeature::SearchPath (AgentManager::AgentRecord *agent)
 The whole path to the target, handed to the crowd as the agent's corridor.
static void NavigationFeature::RequestTarget (AgentManager::AgentRecord *agent)
 Puts the target on the surface closest to it, and searches its path now, or with the next update when this one has searched enough.
static void NavigationFeature::FollowEntity (AgentManager::AgentRecord *agent, const NavAgent &component)
 The crowd follows the entity, which may have been moved by physics or the editor.
static void NavigationFeature::StopAgent (AgentManager::AgentRecord *agent, MoveState state)
static void NavigationFeature::CheckArrival (AgentManager::AgentRecord *agent, const NavAgent &component)
static void NavigationFeature::TurnTowards (Game::World *world, Game::Entity entity, const float *velocity, float turnSpeed, float dt)
 Turns the +z axis of the entity towards where it walks, around the up axis.
static void NavigationFeature::OnNavMeshReloaded (Resources::ResourceId id)
 A reloaded navmesh is checked by the next update, this makes sure a navmesh which is reloaded at the address of the old one isn't missed.
bool NavigationFeature::SetMoveTarget (Game::World *world, Game::Entity entity, const Math::point &target)
 walk to a target. Returns false if the entity has no NavAgent
void NavigationFeature::StopMoving (Game::World *world, Game::Entity entity)
 stop where the agent is
MoveState NavigationFeature::GetMoveState (Game::World *world, Game::Entity entity)
 what the agent is doing, Idle if the entity has no NavAgent
Math::vec3 NavigationFeature::GetAgentVelocity (Game::World *world, Game::Entity entity)
 the velocity the crowd moves the agent with, zero if it isn't moving
Util::Array< Math::point > NavigationFeature::GetAgentCorners (Game::World *world, Game::Entity entity)
 the corners of the path ahead of the agent, the next few the crowd steers by
void NavigationFeature::DrawAgents ()
 draw the agents, their targets and the corners ahead of them

Variables

StreamNavMeshCache * Navigation::navMeshCache
static constexpr int NavigationFeature::MaxSearchesPerUpdate = 16
 how many paths are searched per update.
static constexpr int NavigationFeature::MaxCorridorPolys = 256
 the longest corridor of a Detour crowd, a longer path is planned further as the agent nears its end
static int NavigationFeature::searchesLeft = MaxSearchesPerUpdate
 the searches the current update has left, a target set between updates uses them up too
static uint64_t NavigationFeature::requestCounter = 0
 hands out the order targets were set in, so the searches which wait are done oldest first