File: debug.qc

package info (click to toggle)
nexuiz-data 2.5.2-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,294,288 kB
  • sloc: ansic: 10,523; perl: 6,845; sh: 2,188; java: 1,417; xml: 969; lisp: 519; ruby: 136; makefile: 125
file content (117 lines) | stat: -rw-r--r-- 2,555 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

void mark_error(vector where,float lifetime);
void mark_info(vector where,float lifetime);
entity mark_misc(vector where,float lifetime);


void pathlib_showpath(entity start)
{
    entity e;
    e = start;
    while(e.path_next)
    {
        te_lightning1(e,e.origin,e.path_next.origin);
        e = e.path_next;
    }
}

void path_dbg_think()
{
    pathlib_showpath(self);
    self.nextthink = time + 1;
}

void __showpath2_think()
{
    mark_info(self.origin,1);
    if(self.path_next)
    {
        self.path_next.think     = __showpath2_think;
        self.path_next.nextthink = time + 0.15;
    }
    else
    {
        self.owner.think     = __showpath2_think;
        self.owner.nextthink = time + 0.15;
    }
}

void pathlib_showpath2(entity path)
{
    path.think     = __showpath2_think;
    path.nextthink = time;
}


void pathlib_showsquare2(entity node ,vector ncolor,float align)
{

    node.alpha     = 0.25;
    node.scale     = pathlib_gridsize / 512.001;
    node.solid     = SOLID_NOT;

    setmodel(node,"models/pathlib/square.md3");
    setorigin(node,node.origin);
    node.colormod = ncolor;

    if(align)
    {
        traceline(node.origin + '0 0 32',node.origin - '0 0 128',MOVE_WORLDONLY,node);
        node.angles = vectoangles(trace_plane_normal);
        node.angles_x -= 90;
    }
}

void pathlib_showsquare(vector where,float goodsquare,float lifetime)
{
    entity s;

    if(!lifetime)
        lifetime = time + 30;
    else
        lifetime += time;

    s           = spawn();
    s.alpha     = 0.25;
    s.think     = SUB_Remove;
    s.nextthink = lifetime;
    s.scale     = pathlib_gridsize / 512.001;
    s.solid     = SOLID_NOT;

    if(goodsquare)
        setmodel(s,"models/pathlib/goodsquare.md3");
    else
        setmodel(s,"models/pathlib/badsquare.md3");



    traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,s);

    s.angles = vectoangles(trace_plane_normal);
    s.angles_x -= 90;
    setorigin(s,where);
}

void pathlib_showedge(vector where,float lifetime,float rot)
{
    entity e;

    if(!lifetime)
        lifetime = time + 30;
    else
        lifetime += time;

    e           = spawn();
    e.alpha     = 0.25;
    e.think     = SUB_Remove;
    e.nextthink = lifetime;
    e.scale     = pathlib_gridsize / 512;
    e.solid     = SOLID_NOT;
    setorigin(e,where);
    setmodel(e,"models/pathlib/edge.md3");
    //traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,e);
    //e.angles = vectoangles(trace_plane_normal);
    e.angles_y = rot;
    //e.angles_x += 90;

}