added files, added hash function

This commit is contained in:
2024-07-28 18:06:00 +03:00
parent 62f471e04a
commit cd08f8c742
7 changed files with 118 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
//
// Created by Vlad on 28.07.2024.
//
#include "omath/pathfinding/Astar.h"
#include <unordered_map>
namespace omath::pathfinding
{
struct PathNode final
{
PathNode* cameFrom;
const NavigationVertex* navVertex;
float gCost = 0.f;
};
std::vector<Vector3> Astar::FindPath(const Vector3 &start, const Vector3 &end, const NavigationMesh &navMesh)
{
std::unordered_map<Vector3, PathNode> closedList;
std::unordered_map<Vector3, PathNode> openList;
const auto& startVertex = navMesh.GetClossestVertex(start).value();
const auto& endVertex = navMesh.GetClossestVertex(end).value();
openList.emplace(startVertex.origin, PathNode{nullptr, &startVertex, 0.f});
while (!openList.empty())
{
}
return {};
}
}

View File

@@ -0,0 +1 @@
target_sources(omath PRIVATE NavigationMesh.cpp Astar.cpp)

View File

@@ -0,0 +1,4 @@
//
// Created by Vlad on 28.07.2024.
//
#include "omath/pathfinding/NavigationMesh.h"