32#ifndef DVD_AI_ENTITY_H_
33#define DVD_AI_ENTITY_H_
88 [[nodiscard]]
const string&
name() const noexcept {
return _name; }
96 [[nodiscard]]
const dtCrowdAgent*
getAgent() const noexcept {
return _agent; }
155 [[nodiscard]]
string toString()
const;
173 [[nodiscard]]
bool update(
U64 deltaTimeUS);
223 return entity.
update(deltaTimeUS);
hashMap< SensorType, std::unique_ptr< Sensor > > SensorMap
const string & name() const noexcept
bool setAndSurrenderAIProcessor(AIProcessor *processor)
bool updateDestination(const vec3< F32 > &destination, bool updatePreviousPath=false)
bool update(U64 deltaTimeUS)
void resetCrowd()
Update the crowding system.
vec3< F32 > _currentPosition
F32 _previousDistanceToTarget
bool isMoving() const noexcept
Returns true if this character is moving.
bool _stopped
True if this character is stopped.
F32 getAgentRadius() const noexcept
The radius of the agent for this character.
bool processData(U64 deltaTimeUS)
bool isAgentLoaded() const noexcept
F32 getMaxAcceleration() const noexcept
void processMessage(AIEntity &sender, AIMsg msg, const std::any &msg_content)
void moveBackwards()
Manually control the character moving it backwards.
void setTeamPtr(AITeam *teamPtr)
void updatePosition(U64 deltaTimeUS)
void receiveMessage(AIEntity &sender, AIMsg msg, const std::any &msg_content)
I32 getAgentID() const noexcept
const dtCrowdAgent * _agent
The agent controlling this character.
F32 getSpeed() const noexcept
The current speed this character is traveling at.
vec3< F32 > getVelocity() const noexcept
void setVelocity(const vec3< F32 > &velocity)
F32 getAgentHeight() const noexcept
The height of the agent for this character.
bool processInput(U64 deltaTimeUS)
SharedMutex _managerQueryMutex
F32 getMaxSpeed() const noexcept
Navigation::DivideDtCrowd * _detourCrowd
Crowd in which the agent of this character is.
const dtCrowdAgent * getAgent() const noexcept
The agent that steers this character within the crowd.
bool setPosition(const vec3< F32 > &position)
Place agent at new position.
void sendMessage(AIEntity &receiver, AIMsg msg, const std::any &msg_content)
const vec3< F32 > & getPosition() const noexcept
void setDestination(const vec3< F32 > &destination) noexcept
bool destinationReached() const
Returns true when this agent has reached its set destination.
AITeam * getTeam() const noexcept
bool addSensor(SensorType type)
const vec3< F32 > & getDestination() const noexcept
The destination set for this agent.
std::unique_ptr< AIProcessor > _processor
Sensor * getSensor(SensorType type)
PresetAgentRadius _agentRadiusCategory
void moveForward()
Manually control the character moving it forward.
@ AGENT_RADIUS_EXTRA_LARGE
PresetAgentRadius getAgentRadiusCategory() const noexcept
The radius category of this character.
vec3< F32 > _currentVelocity
NPC * getUnitRef() const noexcept
Provides a scene-level AI implementation.
static bool update(AIEntity &entity, const U64 deltaTimeUS)
static void setTeamPtr(AIEntity &entity, AITeam *const teamPtr)
static bool processInput(AIEntity &entity, const U64 deltaTimeUS)
static bool processData(AIEntity &entity, const U64 deltaTimeUS)
Utility class that adds basic GUID management to objects.
NPC base class. Every character in the game is an NPC by default except the Player.
T length() const noexcept
return the vector's length
Handle console commands that start with a forward slash.
bool IS_ZERO(const T X) noexcept
std::shared_mutex SharedMutex
hashAlg::unordered_map< K, V, HashFun, Predicate > hashMap