Some changes to navmesh path finding, disabled waypoint nav interface for now, might keep it disabled (i don't think anyones using it anyway) added a rule that might need some fine tuning for navmesh pathfinding

This commit is contained in:
KimLS
2018-12-24 14:48:11 -08:00
parent d3aa74ff54
commit e96539e6a8
10 changed files with 307 additions and 27 deletions
+27
View File
@@ -24,6 +24,32 @@ enum PathingPolyFlags
PathingNotDisabled = PathingAll ^ PathingDisabled
};
struct PathfinderOptions
{
PathfinderOptions() {
flags = PathingNotDisabled;
smooth_path = true;
step_size = 10.0f;
flag_cost[0] = 1.0f;
flag_cost[1] = 3.0f;
flag_cost[2] = 5.0f;
flag_cost[3] = 1.0f;
flag_cost[4] = 2.0f;
flag_cost[5] = 2.0f;
flag_cost[6] = 4.0f;
flag_cost[7] = 1.0f;
flag_cost[8] = 0.1f;
flag_cost[9] = 0.1f;
offset = 3.25f;
}
int flags;
bool smooth_path;
float step_size;
float flag_cost[10];
float offset;
};
class IPathfinder
{
public:
@@ -48,6 +74,7 @@ public:
virtual ~IPathfinder() { }
virtual IPath FindRoute(const glm::vec3 &start, const glm::vec3 &end, bool &partial, bool &stuck, int flags = PathingNotDisabled) = 0;
virtual IPath FindPath(const glm::vec3 &start, const glm::vec3 &end, bool &partial, bool &stuck, const PathfinderOptions& opts) = 0;
virtual glm::vec3 GetRandomLocation(const glm::vec3 &start) = 0;
virtual void DebugCommand(Client *c, const Seperator *sep) = 0;