auto navmesh = NavigationMeshFactory::CreateFromFile("resources/navmesh-test.bin");
std::vector<PathFinderAlgorithm> testAlgorithms = {
- PathFinderAlgorithm::DJIKSTRA_SHORTEST_PATH,
+ PathFinderAlgorithm::DIJKSTRA_SHORTEST_PATH,
PathFinderAlgorithm::SPFA,
};
navmesh->SetSceneTransform(Matrix(Matrix::IDENTITY));
std::vector<PathFinderAlgorithm> testAlgorithms = {
- PathFinderAlgorithm::DJIKSTRA_SHORTEST_PATH,
+ PathFinderAlgorithm::DIJKSTRA_SHORTEST_PATH,
PathFinderAlgorithm::SPFA,
PathFinderAlgorithm::SPFA_DOUBLE_WAY, /* Note : Even this algorithm doesn't found shortest path, UTC will pass. */
};
*/
// CLASS HEADER
-#include <dali-scene3d/internal/algorithm/path-finder-djikstra.h>
+#include <dali-scene3d/internal/algorithm/path-finder-dijkstra.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
namespace Dali::Scene3D::Internal::Algorithm
{
-PathFinderAlgorithmDjikstra::PathFinderAlgorithmDjikstra(Dali::Scene3D::Algorithm::NavigationMesh& navMesh)
+PathFinderAlgorithmDijkstra::PathFinderAlgorithmDijkstra(Dali::Scene3D::Algorithm::NavigationMesh& navMesh)
: mNavigationMesh(&GetImplementation(navMesh))
{
PrepareData();
}
-PathFinderAlgorithmDjikstra::~PathFinderAlgorithmDjikstra() = default;
+PathFinderAlgorithmDijkstra::~PathFinderAlgorithmDijkstra() = default;
-Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::FindPath(const Dali::Vector3& positionFrom, const Dali::Vector3& positionTo)
+Scene3D::Algorithm::WayPointList PathFinderAlgorithmDijkstra::FindPath(const Dali::Vector3& positionFrom, const Dali::Vector3& positionTo)
{
Dali::Vector3 outPosFrom;
FaceIndex polyIndexFrom;
return waypoints;
}
-Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::FindPath(FaceIndex sourcePolyIndex, FaceIndex targetPolyIndex)
+Scene3D::Algorithm::WayPointList PathFinderAlgorithmDijkstra::FindPath(FaceIndex sourcePolyIndex, FaceIndex targetPolyIndex)
{
auto nodeCount = uint32_t(mNodes.size());
std::vector<float> dist;
return OptimizeWaypoints(waypoints);
}
-void PathFinderAlgorithmDjikstra::PrepareData()
+void PathFinderAlgorithmDijkstra::PrepareData()
{
// Build the list structure connecting the nodes
auto faceCount = mNavigationMesh->GetFaceCount();
return ccw(A, C, D) != ccw(B, C, D) && ccw(A, B, C) != ccw(A, B, D);
}
-Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::OptimizeWaypoints(WayPointList& waypoints) const
+Scene3D::Algorithm::WayPointList PathFinderAlgorithmDijkstra::OptimizeWaypoints(WayPointList& waypoints) const
{
WayPointList optimizedWaypoints;
optimizedWaypoints.emplace_back(waypoints[0]);
-#ifndef DALI_SCENE3D_INTERNAL_PATH_FINDER_DJIKSTRA_H
-#define DALI_SCENE3D_INTERNAL_PATH_FINDER_DJIKSTRA_H
+#ifndef DALI_SCENE3D_INTERNAL_PATH_FINDER_DIJKSTRA_H
+#define DALI_SCENE3D_INTERNAL_PATH_FINDER_DIJKSTRA_H
/*
* Copyright (c) 2023 Samsung Electronics Co., Ltd.
namespace Dali::Scene3D::Internal::Algorithm
{
-class PathFinderAlgorithmDjikstra : public Dali::Scene3D::Algorithm::PathFinderBase
+class PathFinderAlgorithmDijkstra : public Dali::Scene3D::Algorithm::PathFinderBase
{
public:
/**
*
* @param[in] navMesh Navigation mesh to associate with the algorithm
*/
- explicit PathFinderAlgorithmDjikstra(Dali::Scene3D::Algorithm::NavigationMesh& navMesh);
+ explicit PathFinderAlgorithmDijkstra(Dali::Scene3D::Algorithm::NavigationMesh& navMesh);
/**
* @brief Destructor
*/
- ~PathFinderAlgorithmDjikstra() override;
+ ~PathFinderAlgorithmDijkstra() override;
/**
* @brief Looks for a path from point A to point B.
std::vector<FaceNode> mNodes; ///< List of nodes
};
} // namespace Dali::Scene3D::Internal::Algorithm
-#endif // DALI_SCENE3D_INTERNAL_PATH_FINDER_DJIKSTRA_H
+#endif // DALI_SCENE3D_INTERNAL_PATH_FINDER_DIJKSTRA_H
set(scene3d_src_files ${scene3d_src_files}
${scene3d_internal_dir}/algorithm/navigation-mesh-impl.cpp
- ${scene3d_internal_dir}/algorithm/path-finder-djikstra.cpp
+ ${scene3d_internal_dir}/algorithm/path-finder-dijkstra.cpp
${scene3d_internal_dir}/algorithm/path-finder-spfa.cpp
${scene3d_internal_dir}/algorithm/path-finder-spfa-double-way.cpp
${scene3d_internal_dir}/common/environment-map-load-task.cpp
// INTERNAL INCLUDES
// default algorithm
-#include <dali-scene3d/internal/algorithm/path-finder-djikstra.h>
+#include <dali-scene3d/internal/algorithm/path-finder-dijkstra.h>
#include <dali-scene3d/internal/algorithm/path-finder-spfa-double-way.h>
#include <dali-scene3d/internal/algorithm/path-finder-spfa.h>
switch(algorithm)
{
- case PathFinderAlgorithm::DJIKSTRA_SHORTEST_PATH:
+ case PathFinderAlgorithm::DIJKSTRA_SHORTEST_PATH:
{
- impl = new Dali::Scene3D::Internal::Algorithm::PathFinderAlgorithmDjikstra(navigationMesh);
+ impl = new Dali::Scene3D::Internal::Algorithm::PathFinderAlgorithmDijkstra(navigationMesh);
break;
}
case PathFinderAlgorithm::SPFA:
*/
enum class PathFinderAlgorithm
{
- DJIKSTRA_SHORTEST_PATH, ///< Using A* variant (Djikstra) finding a shortest path
+ DIJKSTRA_SHORTEST_PATH, ///< Using A* variant (Dijkstra) finding a shortest path
SPFA, ///< Using SPFA-SLF (Shortest Path Fast Algorithm with Short Label First) finding a shortest path.
SPFA_DOUBLE_WAY, ///< Using SPFA-SLF double way. It might not find shortest, but will use less memory.
- DEFAULT = DJIKSTRA_SHORTEST_PATH, ///< Default algorithm to use
+ DEFAULT = DIJKSTRA_SHORTEST_PATH, ///< Default algorithm to use
};
/**