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