mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-14 07:23:26 +00:00
added files, added hash function
This commit is contained in:
20
include/omath/pathfinding/Astar.h
Normal file
20
include/omath/pathfinding/Astar.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Created by Vlad on 28.07.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include "NavigationMesh.h"
|
||||
#include "omath/Vector3.h"
|
||||
|
||||
|
||||
namespace omath::pathfinding
|
||||
{
|
||||
class Astar
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static std::vector<Vector3> FindPath(const Vector3& start, const Vector3& end, const NavigationMesh& navMesh);
|
||||
|
||||
};
|
||||
}
|
||||
33
include/omath/pathfinding/NavigationMesh.h
Normal file
33
include/omath/pathfinding/NavigationMesh.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Created by Vlad on 28.07.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/Vector3.h"
|
||||
#include <expected>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace omath::pathfinding
|
||||
{
|
||||
struct NavigationVertex
|
||||
{
|
||||
Vector3 origin;
|
||||
std::vector<Vector3*> connections;
|
||||
};
|
||||
|
||||
|
||||
class NavigationMesh final
|
||||
{
|
||||
public:
|
||||
|
||||
[[nodiscard]]
|
||||
std::expected<const NavigationVertex, std::string> GetClossestVertex(const Vector3& point) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user