File: pathlib.qh

package info (click to toggle)
nexuiz-data 2.5.2-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,294,288 kB
  • sloc: ansic: 10,523; perl: 6,845; sh: 2,188; java: 1,417; xml: 969; lisp: 519; ruby: 136; makefile: 125
file content (99 lines) | stat: -rw-r--r-- 3,084 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.entity path_next;
.entity path_prev;

#define inwater(point) (pointcontents(point) == CONTENT_WATER)
#define medium spawnshieldtime

#define PLIB_FORWARD '0 1 0'
//#define PLIB_BACK    '0 -1 0'
#define PLIB_RIGHT   '1 0 0'
//#define PLIB_LEFT    '-1 0 0'

#define DEBUGPATHING
#ifdef DEBUGPATHING
void pathlib_showpath(entity start);
void pathlib_showpath2(entity path);
#endif

entity openlist;
entity closedlist;
entity goal_node;

.float is_path_node;
.float pathlib_node_g;
.float pathlib_node_h;
.float pathlib_node_f;

float pathlib_open_cnt;
float pathlib_closed_cnt;
float pathlib_made_cnt;
float pathlib_merge_cnt;
float pathlib_searched_cnt;
float pathlib_bestopen_seached;
float pathlib_bestcash_hits;
float pathlib_bestcash_saved;
float pathlib_gridsize;
float pathlib_movecost;
float pathlib_movecost_diag;
float pathlib_movecost_waterfactor;
float pathlib_foundgoal;

float pathlib_starttime;
#define pathlib_maxtime 5

entity best_open_node;

vector tile_check_up;
vector tile_check_down;
float  tile_check_size;
float      tile_check_cross(vector where);
float      tile_check_plus(vector where);
float      tile_check_star(vector where);
var float  tile_check(vector where);

float  movenode_stepsize;
vector movenode_stepup;
vector movenode_maxdrop;
vector movenode_boxup;
vector movenode_boxmax;
vector movenode_boxmin;
float  pathlib_movenode_goodnode;

vector     pathlib_wateroutnode(vector start, vector end);
vector     pathlib_swimnode(vector start, vector end);
vector     pathlib_flynode(vector start, vector end);
vector     pathlib_walknode(vector start, vector end, float doedge);
var vector pathlib_movenode(vector start, vector end, float doedge);

float      pathlib_expandnode_star(entity node, vector start, vector goal);
float      pathlib_expandnode_box(entity node, vector start, vector goal);
float      pathlib_expandnode_octagon(entity node, vector start, vector goal);
var float  pathlib_expandnode(entity node, vector start, vector goal);

float      pathlib_g_static(entity parent, vector to, float static_cost);
float      pathlib_g_static_water(entity parent, vector to, float static_cost);
float      pathlib_g_euclidean(entity parent, vector to, float static_cost);
float      pathlib_g_euclidean_water(entity parent, vector to, float static_cost);
var float  pathlib_cost(entity parent, vector to, float static_cost);

float      pathlib_h_manhattan(vector a, vector b);
float      pathlib_h_diagonal(vector a, vector b);
float      pathlib_h_euclidean(vector a,vector b);
float      pathlib_h_diagonal2(vector a, vector b);
float      pathlib_h_diagonal3(vector a, vector b);
float      pathlib_h_diagonal2sdp(vector preprev, vector prev, vector point, vector end);
var float  pathlib_heuristic(vector from, vector to);

var float  pathlib_makenode(entity parent,vector start, vector to, vector goal,float cost);
var float  buildpath_nodefilter(vector n,vector c,vector p);


#ifdef DEBUGPATHING
#include "debug.qc"
#endif

#include "utility.qc"
#include "movenode.qc"
#include "costs.qc"
#include "expandnode.qc"
#include "main.qc"