Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
NavAgentComponent.hpp
1#pragma once
2
3#include <entt/entity/handle.hpp>
4
5#include <Grindstone.Ai.NavMesh/include/NavAgentType.hpp>
6#include <Grindstone.Ai.NavMesh/include/NavMeshAreaTypes.hpp>
7#include <Grindstone.Ai.NavMesh/include/NavAgentLocomotionData.hpp>
8#include <DetourNavMesh.h>
9
10class dtNavMeshQuery;
11
12namespace Grindstone::Ai {
14 NavAgentTypeId typeId;
15 float baseOffset;
16 float movementSpeed;
17 float angularSpeed;
18 float acceleration;
19 float stoppingDistance;
20 bool autoBraking;
21 float obstacleAvoidanceRadius;
22 float obstacleAvoidanceHeight;
23 float obstacleAvoidanceQuality;
24 float obstacleAvoidancePriority;
25 bool autoTraverseOffMesh;
26 bool autoRepath;
27 NavAreaId areaMask; // one bit per area type
28
29 bool SetTarget(entt::entity entityHandle, glm::vec3 endPosition);
30 const dtNavMeshQuery* GetNavMeshQuery() const;
31 const NavMeshLocomotionData GetLocomotionData() const;
32 glm::vec3 destination;
33 static const int MAX_POLYS = 256;
34
35 protected:
36 dtNavMeshQuery* navMeshQuery = nullptr;
37 NavMeshLocomotionData locomotionData;
38 dtPolyRef pathPolys[MAX_POLYS];
39 int usedPolyCount = 0;
40
41 REFLECT("NavigationAgent")
42 };
43}
Definition NavAgentComponent.hpp:12
Definition NavAgentComponent.hpp:13
Definition NavAgentLocomotionData.hpp:6