]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/pathlib/pathlib.qh
Merge branch 'master' into divVerent/bastet
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / pathlib.qh
1 .entity path_next;
2 .entity path_prev;
3
4 #define inwater(point) (pointcontents(point) == CONTENT_WATER)
5 #define medium spawnshieldtime
6
7 #define PLIB_FORWARD '0 1 0'
8 //#define PLIB_BACK    '0 -1 0'
9 #define PLIB_RIGHT   '1 0 0'
10 //#define PLIB_LEFT    '-1 0 0'
11
12 #define DEBUGPATHING
13 #ifdef DEBUGPATHING
14 void pathlib_showpath(entity start);
15 void pathlib_showpath2(entity path);
16 #endif
17
18 entity openlist;
19 entity closedlist;
20 entity edgelist;
21 entity goal_node;
22
23 .float is_path_node;
24 .float pathlib_node_g;
25 .float pathlib_node_h;
26 .float pathlib_node_f;
27
28 #define pathlib_node_edgeflag_unknown        0
29 #define pathlib_node_edgeflag_left           2
30 #define pathlib_node_edgeflag_right          4
31 #define pathlib_node_edgeflag_forward        8
32 #define pathlib_node_edgeflag_back           16
33 #define pathlib_node_edgeflag_backleft       32
34 #define pathlib_node_edgeflag_backright      64
35 #define pathlib_node_edgeflag_forwardleft    128
36 #define pathlib_node_edgeflag_forwardright   256
37 #define pathlib_node_edgeflag_none           512
38 .float pathlib_node_edgeflags;
39
40 float pathlib_open_cnt;
41 float pathlib_closed_cnt;
42 float pathlib_made_cnt;
43 float pathlib_merge_cnt;
44 float pathlib_searched_cnt;
45 float pathlib_bestopen_seached;
46 float pathlib_bestcash_hits;
47 float pathlib_bestcash_saved;
48 float pathlib_gridsize;
49 float pathlib_movecost;
50 float pathlib_movecost_diag;
51 float pathlib_movecost_waterfactor;
52 float pathlib_foundgoal;
53
54 float pathlib_starttime;
55 #define pathlib_maxtime 60
56
57 entity best_open_node;
58
59 vector tile_check_up;
60 vector tile_check_down;
61 float  tile_check_size;
62 float      tile_check_cross(vector where);
63 float      tile_check_plus(vector where);
64 float      tile_check_star(vector where);
65 var float  tile_check(vector where);
66
67 float  movenode_stepsize;
68 vector movenode_stepup;
69 vector movenode_maxdrop;
70 vector movenode_boxup;
71 vector movenode_boxmax;
72 vector movenode_boxmin;
73 float  pathlib_movenode_goodnode;
74
75 vector     pathlib_wateroutnode(vector start, vector end);
76 vector     pathlib_swimnode(vector start, vector end);
77 vector     pathlib_flynode(vector start, vector end);
78 vector     pathlib_walknode(vector start, vector end, float doedge);
79 var vector pathlib_movenode(vector start, vector end, float doedge);
80
81 float      pathlib_expandnode_star(entity node, vector start, vector goal);
82 float      pathlib_expandnode_box(entity node, vector start, vector goal);
83 float      pathlib_expandnode_octagon(entity node, vector start, vector goal);
84 var float  pathlib_expandnode(entity node, vector start, vector goal);
85
86 float      pathlib_g_static(entity parent, vector to, float static_cost);
87 float      pathlib_g_static_water(entity parent, vector to, float static_cost);
88 float      pathlib_g_euclidean(entity parent, vector to, float static_cost);
89 float      pathlib_g_euclidean_water(entity parent, vector to, float static_cost);
90 var float  pathlib_cost(entity parent, vector to, float static_cost);
91
92 float      pathlib_h_manhattan(vector a, vector b);
93 float      pathlib_h_diagonal(vector a, vector b);
94 float      pathlib_h_euclidean(vector a,vector b);
95 float      pathlib_h_diagonal2(vector a, vector b);
96 float      pathlib_h_diagonal3(vector a, vector b);
97 float      pathlib_h_diagonal2sdp(vector preprev, vector prev, vector point, vector end);
98 var float  pathlib_heuristic(vector from, vector to);
99
100 var float  pathlib_makenode(entity parent,vector start, vector to, vector goal,float cost);
101 var float  buildpath_nodefilter(vector n,vector c,vector p);
102
103
104 #ifdef DEBUGPATHING
105 #include "debug.qc"
106 #endif
107
108 #include "utility.qc"
109 #include "movenode.qc"
110 #include "costs.qc"
111 #include "expandnode.qc"
112 #include "main.qc"
113 #include "path_waypoint.qc"