summaryrefslogtreecommitdiff
path: root/engine-ocean/Game/Components/pathfindcomponent.cpp
blob: ad87e2374506c24f16d765a87fea604ab3bed942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "pathfindcomponent.h"
#include "glm/glm.hpp"
#include <vector>

PathfindComponent::PathfindComponent(std::vector<glm::vec3> vertices, std::vector<glm::ivec3> triangles):
    m_vertices(vertices),
    m_triangles(triangles),
    m_pathfinder(std::make_unique<Pathfinder>(vertices, triangles))
{

}


std::vector<glm::vec3> PathfindComponent::getPath(const glm::vec3 &A, const glm::vec3 &B){
    return m_pathfinder->findPath(A,B);
}