mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
31 lines
920 B
C++
31 lines
920 B
C++
//
|
|
// Created by Vlad on 28.07.2024.
|
|
//
|
|
|
|
#pragma once
|
|
#include <vector>
|
|
#include "omath/pathfinding/navigation_mesh.hpp"
|
|
#include "omath/vector3.hpp"
|
|
|
|
namespace omath::pathfinding
|
|
{
|
|
struct PathNode;
|
|
class Astar final
|
|
{
|
|
public:
|
|
[[nodiscard]]
|
|
static std::vector<Vector3<float>> FindPath(const Vector3<float>& start, const Vector3<float>& end,
|
|
const NavigationMesh& navMesh);
|
|
|
|
private:
|
|
[[nodiscard]]
|
|
static std::vector<Vector3<float>>
|
|
ReconstructFinalPath(const std::unordered_map<Vector3<float>, PathNode>& closedList,
|
|
const Vector3<float>& current);
|
|
|
|
[[nodiscard]]
|
|
static auto GetPerfectNode(const std::unordered_map<Vector3<float>, PathNode>& openList,
|
|
const Vector3<float>& endVertex);
|
|
};
|
|
} // namespace omath::pathfinding
|