Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
debug.qc
Go to the documentation of this file.
1#include "debug.qh"
2
3#if DEBUGPATHING
4
5MODEL(SQUARE, "models/pathlib/square.md3");
6MODEL(SQUARE_GOOD, "models/pathlib/goodsquare.md3");
7MODEL(SQUARE_BAD, "models/pathlib/badsquare.md3");
8MODEL(EDGE, "models/pathlib/edge.md3");
9
10#ifdef TURRET_DEBUG
12#endif
13
14void pathlib_showpath(entity start)
15{
16 entity e = start;
17 while(e.path_next)
18 {
19 te_lightning1(e,e.origin,e.path_next.origin);
20 e = e.path_next;
21 }
22}
23
24void path_dbg_think(entity this)
25{
26 pathlib_showpath(this);
27 this.nextthink = time + 1;
28}
29
30void __showpath2_think(entity this)
31{
32 #ifdef TURRET_DEBUG
33 mark_info(this.origin,1);
34 #endif
35 if(this.path_next)
36 {
37 setthink(this.path_next, __showpath2_think);
38 this.path_next.nextthink = time + 0.15;
39 }
40 else
41 {
42 setthink(this.owner, __showpath2_think);
43 this.owner.nextthink = time + 0.15;
44 }
45}
46
47void pathlib_showpath2(entity path)
48{
49 setthink(path, __showpath2_think);
50 path.nextthink = time;
51}
52
53void pathlib_showsquare2(entity node ,vector ncolor,float align)
54{
55
56 node.alpha = 0.25;
57 node.scale = pathlib_gridsize / 512.001;
58 node.solid = SOLID_NOT;
59
60 setmodel(node, MDL_SQUARE);
61 setorigin(node, node.origin);
62 node.colormod = ncolor;
63
64 if(align)
65 {
66 traceline(node.origin + '0 0 32', node.origin - '0 0 128', MOVE_WORLDONLY, node);
67 node.angles = vectoangles(trace_plane_normal);
68 node.angles_x -= 90;
69 }
70}
71
72void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
73{
74 entity s;
75
76 if(!_lifetime)
77 _lifetime = time + 30;
78 else
79 _lifetime += time;
80
81 s = spawn();
82 s.alpha = 0.25;
84 s.nextthink = _lifetime;
85 s.scale = pathlib_gridsize / 512.001;
86 s.solid = SOLID_NOT;
87
88 setmodel(s, goodsquare ? MDL_SQUARE_GOOD : MDL_SQUARE_BAD);
89
90 traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,s);
91
93 s.angles_x -= 90;
94 setorigin(s, where);
95}
96
97void pathlib_showedge(vector where,float _lifetime,float rot)
98{
99 entity e;
100
101 if(!_lifetime)
102 _lifetime = time + 30;
103 else
104 _lifetime += time;
105
106 e = spawn();
107 e.alpha = 0.25;
109 e.nextthink = _lifetime;
110 e.scale = pathlib_gridsize / 512;
111 e.solid = SOLID_NOT;
112 setorigin(e, where);
113 setmodel(e, MDL_EDGE);
114 //traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,e);
115 //e.angles = vectoangles(trace_plane_normal);
116 e.angles_y = rot;
117 //e.angles_x += 90;
118
119}
120
121#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity owner
Definition main.qh:87
#define setmodel(this, m)
Definition model.qh:26
const float SOLID_NOT
float time
float nextthink
float MOVE_WORLDONLY
vector origin
vector trace_plane_normal
#define spawn
void SUB_Remove(entity this)
Remove entity.
Definition defer.qh:13
vector vectoangles(vector v)
#define MODEL(name, path)
Definition all.qh:8
entity path_next
Definition pathlib.qh:8
float pathlib_gridsize
Definition pathlib.qh:50
#define setthink(e, f)
vector
Definition self.qh:92