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