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