2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2013 sapier, sapier at gmx dot net
|
2013-03-17 17:03:44 +00:00
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2013-03-17 17:03:44 +00:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Includes */
|
|
|
|
/******************************************************************************/
|
|
|
|
#include <vector>
|
|
|
|
#include "irr_v3d.h"
|
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
/******************************************************************************/
|
|
|
|
/* Forward declarations */
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2020-04-11 19:59:43 +02:00
|
|
|
class NodeDefManager;
|
|
|
|
class Map;
|
2013-08-11 04:09:45 +02:00
|
|
|
|
2013-03-17 17:03:44 +00:00
|
|
|
/******************************************************************************/
|
|
|
|
/* Typedefs and macros */
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
DIR_XP,
|
|
|
|
DIR_XM,
|
|
|
|
DIR_ZP,
|
|
|
|
DIR_ZM
|
2016-04-01 01:52:17 +02:00
|
|
|
} PathDirections;
|
2013-03-17 17:03:44 +00:00
|
|
|
|
|
|
|
/** List of supported algorithms */
|
|
|
|
typedef enum {
|
2016-04-01 01:52:17 +02:00
|
|
|
PA_DIJKSTRA, /**< Dijkstra shortest path algorithm */
|
|
|
|
PA_PLAIN, /**< A* algorithm using heuristics to find a path */
|
|
|
|
PA_PLAIN_NP /**< A* algorithm without prefetching of map data */
|
|
|
|
} PathAlgorithm;
|
2013-03-17 17:03:44 +00:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* declarations */
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
/** c wrapper function to use from scriptapi */
|
2020-04-11 19:59:43 +02:00
|
|
|
std::vector<v3s16> get_path(Map *map, const NodeDefManager *ndef,
|
|
|
|
v3s16 source,
|
|
|
|
v3s16 destination,
|
|
|
|
unsigned int searchdistance,
|
|
|
|
unsigned int max_jump,
|
|
|
|
unsigned int max_drop,
|
|
|
|
PathAlgorithm algo);
|