vkQuake2 doxygen  1.0 dev
sv_world.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 // world.c -- world query functions
21 
22 #include "server.h"
23 #include <inttypes.h>
24 
25 /*
26 ===============================================================================
27 
28 ENTITY AREA CHECKING
29 
30 FIXME: this use of "area" is different from the bsp file use
31 ===============================================================================
32 */
33 
34 // (type *)STRUCT_FROM_LINK(link_t *link, type, member)
35 // ent = STRUCT_FROM_LINK(link,entity_t,order)
36 // FIXME: remove this mess!
37 #define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (intptr_t)&(((t *)0)->m)))
38 
39 #define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area)
40 
41 typedef struct areanode_s
42 {
43  int axis; // -1 = leaf node
44  float dist;
45  struct areanode_s *children[2];
48 } areanode_t;
49 
50 #define AREA_DEPTH 4
51 #define AREA_NODES 32
52 
55 
60 
61 int SV_HullForEntity (edict_t *ent);
62 
63 
64 // ClearLink is used for new headnodes
65 void ClearLink (link_t *l)
66 {
67  l->prev = l->next = l;
68 }
69 
70 void RemoveLink (link_t *l)
71 {
72  l->next->prev = l->prev;
73  l->prev->next = l->next;
74 }
75 
76 void InsertLinkBefore (link_t *l, link_t *before)
77 {
78  l->next = before;
79  l->prev = before->prev;
80  l->prev->next = l;
81  l->next->prev = l;
82 }
83 
84 /*
85 ===============
86 SV_CreateAreaNode
87 
88 Builds a uniformly subdivided tree for the given world size
89 ===============
90 */
91 areanode_t *SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs)
92 {
93  areanode_t *anode;
94  vec3_t size;
95  vec3_t mins1, maxs1, mins2, maxs2;
96 
97  anode = &sv_areanodes[sv_numareanodes];
99 
100  ClearLink (&anode->trigger_edicts);
101  ClearLink (&anode->solid_edicts);
102 
103  if (depth == AREA_DEPTH)
104  {
105  anode->axis = -1;
106  anode->children[0] = anode->children[1] = NULL;
107  return anode;
108  }
109 
110  VectorSubtract (maxs, mins, size);
111  if (size[0] > size[1])
112  anode->axis = 0;
113  else
114  anode->axis = 1;
115 
116  anode->dist = 0.5 * (maxs[anode->axis] + mins[anode->axis]);
117  VectorCopy (mins, mins1);
118  VectorCopy (mins, mins2);
119  VectorCopy (maxs, maxs1);
120  VectorCopy (maxs, maxs2);
121 
122  maxs1[anode->axis] = mins2[anode->axis] = anode->dist;
123 
124  anode->children[0] = SV_CreateAreaNode (depth+1, mins2, maxs2);
125  anode->children[1] = SV_CreateAreaNode (depth+1, mins1, maxs1);
126 
127  return anode;
128 }
129 
130 /*
131 ===============
132 SV_ClearWorld
133 
134 ===============
135 */
136 void SV_ClearWorld (void)
137 {
138  memset (sv_areanodes, 0, sizeof(sv_areanodes));
139  sv_numareanodes = 0;
140  SV_CreateAreaNode (0, sv.models[1]->mins, sv.models[1]->maxs);
141 }
142 
143 
144 /*
145 ===============
146 SV_UnlinkEdict
147 
148 ===============
149 */
151 {
152  if (!ent->area.prev)
153  return; // not linked in anywhere
154  RemoveLink (&ent->area);
155  ent->area.prev = ent->area.next = NULL;
156 }
157 
158 
159 /*
160 ===============
161 SV_LinkEdict
162 
163 ===============
164 */
165 #define MAX_TOTAL_ENT_LEAFS 128
167 {
168  areanode_t *node;
169  int leafs[MAX_TOTAL_ENT_LEAFS];
170  int clusters[MAX_TOTAL_ENT_LEAFS];
171  int num_leafs;
172  int i, j, k;
173  int area;
174  int topnode;
175 
176  if (ent->area.prev)
177  SV_UnlinkEdict (ent); // unlink from old position
178 
179  if (ent == ge->edicts)
180  return; // don't add the world
181 
182  if (!ent->inuse)
183  return;
184 
185  // set the size
186  VectorSubtract (ent->maxs, ent->mins, ent->size);
187 
188  // encode the size into the entity_state for client prediction
189  if (ent->solid == SOLID_BBOX && !(ent->svflags & SVF_DEADMONSTER))
190  { // assume that x/y are equal and symetric
191  i = ent->maxs[0]/8;
192  if (i<1)
193  i = 1;
194  if (i>31)
195  i = 31;
196 
197  // z is not symetric
198  j = (-ent->mins[2])/8;
199  if (j<1)
200  j = 1;
201  if (j>31)
202  j = 31;
203 
204  // and z maxs can be negative...
205  k = (ent->maxs[2]+32)/8;
206  if (k<1)
207  k = 1;
208  if (k>63)
209  k = 63;
210 
211  ent->s.solid = (k<<10) | (j<<5) | i;
212  }
213  else if (ent->solid == SOLID_BSP)
214  {
215  ent->s.solid = 31; // a solid_bbox will never create this value
216  }
217  else
218  ent->s.solid = 0;
219 
220  // set the abs box
221  if (ent->solid == SOLID_BSP &&
222  (ent->s.angles[0] || ent->s.angles[1] || ent->s.angles[2]) )
223  { // expand for rotation
224  float max, v;
225  int i;
226 
227  max = 0;
228  for (i=0 ; i<3 ; i++)
229  {
230  v =fabs( ent->mins[i]);
231  if (v > max)
232  max = v;
233  v =fabs( ent->maxs[i]);
234  if (v > max)
235  max = v;
236  }
237  for (i=0 ; i<3 ; i++)
238  {
239  ent->absmin[i] = ent->s.origin[i] - max;
240  ent->absmax[i] = ent->s.origin[i] + max;
241  }
242  }
243  else
244  { // normal
245  VectorAdd (ent->s.origin, ent->mins, ent->absmin);
246  VectorAdd (ent->s.origin, ent->maxs, ent->absmax);
247  }
248 
249  // because movement is clipped an epsilon away from an actual edge,
250  // we must fully check even when bounding boxes don't quite touch
251  ent->absmin[0] -= 1;
252  ent->absmin[1] -= 1;
253  ent->absmin[2] -= 1;
254  ent->absmax[0] += 1;
255  ent->absmax[1] += 1;
256  ent->absmax[2] += 1;
257 
258 // link to PVS leafs
259  ent->num_clusters = 0;
260  ent->areanum = 0;
261  ent->areanum2 = 0;
262 
263  //get all leafs, including solids
264  num_leafs = CM_BoxLeafnums (ent->absmin, ent->absmax,
265  leafs, MAX_TOTAL_ENT_LEAFS, &topnode);
266 
267  // set areas
268  for (i=0 ; i<num_leafs ; i++)
269  {
270  clusters[i] = CM_LeafCluster (leafs[i]);
271  area = CM_LeafArea (leafs[i]);
272  if (area)
273  { // doors may legally straggle two areas,
274  // but nothing should evern need more than that
275  if (ent->areanum && ent->areanum != area)
276  {
277  if (ent->areanum2 && ent->areanum2 != area && sv.state == ss_loading)
278  Com_DPrintf ("Object touching 3 areas at %f %f %f\n",
279  ent->absmin[0], ent->absmin[1], ent->absmin[2]);
280  ent->areanum2 = area;
281  }
282  else
283  ent->areanum = area;
284  }
285  }
286 
287  if (num_leafs >= MAX_TOTAL_ENT_LEAFS)
288  { // assume we missed some leafs, and mark by headnode
289  ent->num_clusters = -1;
290  ent->headnode = topnode;
291  }
292  else
293  {
294  ent->num_clusters = 0;
295  for (i=0 ; i<num_leafs ; i++)
296  {
297  if (clusters[i] == -1)
298  continue; // not a visible leaf
299  for (j=0 ; j<i ; j++)
300  if (clusters[j] == clusters[i])
301  break;
302  if (j == i)
303  {
304  if (ent->num_clusters == MAX_ENT_CLUSTERS)
305  { // assume we missed some leafs, and mark by headnode
306  ent->num_clusters = -1;
307  ent->headnode = topnode;
308  break;
309  }
310 
311  ent->clusternums[ent->num_clusters++] = clusters[i];
312  }
313  }
314  }
315 
316  // if first time, make sure old_origin is valid
317  if (!ent->linkcount)
318  {
319  VectorCopy (ent->s.origin, ent->s.old_origin);
320  }
321  ent->linkcount++;
322 
323  if (ent->solid == SOLID_NOT)
324  return;
325 
326 // find the first node that the ent's box crosses
327  node = sv_areanodes;
328  while (1)
329  {
330  if (node->axis == -1)
331  break;
332  if (ent->absmin[node->axis] > node->dist)
333  node = node->children[0];
334  else if (ent->absmax[node->axis] < node->dist)
335  node = node->children[1];
336  else
337  break; // crosses the node
338  }
339 
340  // link it in
341  if (ent->solid == SOLID_TRIGGER)
342  InsertLinkBefore (&ent->area, &node->trigger_edicts);
343  else
344  InsertLinkBefore (&ent->area, &node->solid_edicts);
345 
346 }
347 
348 
349 /*
350 ====================
351 SV_AreaEdicts_r
352 
353 ====================
354 */
356 {
357  link_t *l, *next, *start;
358  edict_t *check;
359  int count;
360 
361  count = 0;
362 
363  // touch linked edicts
364  if (area_type == AREA_SOLID)
365  start = &node->solid_edicts;
366  else
367  start = &node->trigger_edicts;
368 
369  for (l=start->next ; l != start ; l = next)
370  {
371  next = l->next;
372  check = EDICT_FROM_AREA(l);
373 
374  if (check->solid == SOLID_NOT)
375  continue; // deactivated
376  if (check->absmin[0] > area_maxs[0]
377  || check->absmin[1] > area_maxs[1]
378  || check->absmin[2] > area_maxs[2]
379  || check->absmax[0] < area_mins[0]
380  || check->absmax[1] < area_mins[1]
381  || check->absmax[2] < area_mins[2])
382  continue; // not touching
383 
384  if (area_count == area_maxcount)
385  {
386  Com_Printf ("SV_AreaEdicts: MAXCOUNT\n");
387  return;
388  }
389 
390  area_list[area_count] = check;
391  area_count++;
392  }
393 
394  if (node->axis == -1)
395  return; // terminal node
396 
397  // recurse down both sides
398  if ( area_maxs[node->axis] > node->dist )
399  SV_AreaEdicts_r ( node->children[0] );
400  if ( area_mins[node->axis] < node->dist )
401  SV_AreaEdicts_r ( node->children[1] );
402 }
403 
404 /*
405 ================
406 SV_AreaEdicts
407 ================
408 */
409 int SV_AreaEdicts (vec3_t mins, vec3_t maxs, edict_t **list,
410  int maxcount, int areatype)
411 {
412  area_mins = mins;
413  area_maxs = maxs;
414  area_list = list;
415  area_count = 0;
416  area_maxcount = maxcount;
417  area_type = areatype;
418 
420 
421  return area_count;
422 }
423 
424 
425 //===========================================================================
426 
427 /*
428 =============
429 SV_PointContents
430 =============
431 */
433 {
434  edict_t *touch[MAX_EDICTS], *hit;
435  int i, num;
436  int contents, c2;
437  int headnode;
438  float *angles;
439 
440  // get base contents from world
441  contents = CM_PointContents (p, sv.models[1]->headnode);
442 
443  // or in contents from all the other entities
444  num = SV_AreaEdicts (p, p, touch, MAX_EDICTS, AREA_SOLID);
445 
446  for (i=0 ; i<num ; i++)
447  {
448  hit = touch[i];
449 
450  // might intersect, so do an exact clip
451  headnode = SV_HullForEntity (hit);
452  angles = hit->s.angles;
453  if (hit->solid != SOLID_BSP)
454  angles = vec3_origin; // boxes don't rotate
455 
456  c2 = CM_TransformedPointContents (p, headnode, hit->s.origin, hit->s.angles);
457 
458  contents |= c2;
459  }
460 
461  return contents;
462 }
463 
464 
465 
466 typedef struct
467 {
468  vec3_t boxmins, boxmaxs;// enclose the test object along entire move
469  float *mins, *maxs; // size of the moving object
470  vec3_t mins2, maxs2; // size when clipping against mosnters
471  float *start, *end;
475 } moveclip_t;
476 
477 
478 
479 /*
480 ================
481 SV_HullForEntity
482 
483 Returns a headnode that can be used for testing or clipping an
484 object of mins/maxs size.
485 Offset is filled in to contain the adjustment that must be added to the
486 testing object's origin to get a point to use with the returned hull.
487 ================
488 */
490 {
491  cmodel_t *model;
492 
493 // decide which clipping hull to use, based on the size
494  if (ent->solid == SOLID_BSP)
495  { // explicit hulls in the BSP model
496  model = sv.models[ ent->s.modelindex ];
497 
498  if (!model)
499  Com_Error (ERR_FATAL, "MOVETYPE_PUSH with a non bsp model");
500 
501  return model->headnode;
502  }
503 
504  // create a temp hull from bounding box sizes
505 
506  return CM_HeadnodeForBox (ent->mins, ent->maxs);
507 }
508 
509 
510 //===========================================================================
511 
512 /*
513 ====================
514 SV_ClipMoveToEntities
515 
516 ====================
517 */
519 {
520  int i, num;
521  edict_t *touchlist[MAX_EDICTS], *touch;
522  trace_t trace;
523  int headnode;
524  float *angles;
525 
526  num = SV_AreaEdicts (clip->boxmins, clip->boxmaxs, touchlist
528 
529  // be careful, it is possible to have an entity in this
530  // list removed before we get to it (killtriggered)
531  for (i=0 ; i<num ; i++)
532  {
533  touch = touchlist[i];
534  if (touch->solid == SOLID_NOT)
535  continue;
536  if (touch == clip->passedict)
537  continue;
538  if (clip->trace.allsolid)
539  return;
540  if (clip->passedict)
541  {
542  if (touch->owner == clip->passedict)
543  continue; // don't clip against own missiles
544  if (clip->passedict->owner == touch)
545  continue; // don't clip against owner
546  }
547 
548  if ( !(clip->contentmask & CONTENTS_DEADMONSTER)
549  && (touch->svflags & SVF_DEADMONSTER) )
550  continue;
551 
552  // might intersect, so do an exact clip
553  headnode = SV_HullForEntity (touch);
554  angles = touch->s.angles;
555  if (touch->solid != SOLID_BSP)
556  angles = vec3_origin; // boxes don't rotate
557 
558  if (touch->svflags & SVF_MONSTER)
559  trace = CM_TransformedBoxTrace (clip->start, clip->end,
560  clip->mins2, clip->maxs2, headnode, clip->contentmask,
561  touch->s.origin, angles);
562  else
563  trace = CM_TransformedBoxTrace (clip->start, clip->end,
564  clip->mins, clip->maxs, headnode, clip->contentmask,
565  touch->s.origin, angles);
566 
567  if (trace.allsolid || trace.startsolid ||
568  trace.fraction < clip->trace.fraction)
569  {
570  trace.ent = touch;
571  if (clip->trace.startsolid)
572  {
573  clip->trace = trace;
574  clip->trace.startsolid = true;
575  }
576  else
577  clip->trace = trace;
578  }
579  else if (trace.startsolid)
580  clip->trace.startsolid = true;
581  }
582 }
583 
584 
585 /*
586 ==================
587 SV_TraceBounds
588 ==================
589 */
590 void SV_TraceBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
591 {
592 #if 0
593 // debug to test against everything
594 boxmins[0] = boxmins[1] = boxmins[2] = -9999;
595 boxmaxs[0] = boxmaxs[1] = boxmaxs[2] = 9999;
596 #else
597  int i;
598 
599  for (i=0 ; i<3 ; i++)
600  {
601  if (end[i] > start[i])
602  {
603  boxmins[i] = start[i] + mins[i] - 1;
604  boxmaxs[i] = end[i] + maxs[i] + 1;
605  }
606  else
607  {
608  boxmins[i] = end[i] + mins[i] - 1;
609  boxmaxs[i] = start[i] + maxs[i] + 1;
610  }
611  }
612 #endif
613 }
614 
615 /*
616 ==================
617 SV_Trace
618 
619 Moves the given mins/maxs volume through the world from start to end.
620 
621 Passedict and edicts owned by passedict are explicitly not checked.
622 
623 ==================
624 */
625 trace_t SV_Trace (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passedict, int contentmask)
626 {
627  moveclip_t clip;
628 
629  if (!mins)
630  mins = vec3_origin;
631  if (!maxs)
632  maxs = vec3_origin;
633 
634  memset ( &clip, 0, sizeof ( moveclip_t ) );
635 
636  // clip to world
637  clip.trace = CM_BoxTrace (start, end, mins, maxs, 0, contentmask);
638  clip.trace.ent = ge->edicts;
639  if (clip.trace.fraction == 0)
640  return clip.trace; // blocked by the world
641 
642  clip.contentmask = contentmask;
643  clip.start = start;
644  clip.end = end;
645  clip.mins = mins;
646  clip.maxs = maxs;
647  clip.passedict = passedict;
648 
649  VectorCopy (mins, clip.mins2);
650  VectorCopy (maxs, clip.maxs2);
651 
652  // create the bounding box of the entire move
653  SV_TraceBounds ( start, clip.mins2, clip.maxs2, end, clip.boxmins, clip.boxmaxs );
654 
655  // clip to other solid entities
656  SV_ClipMoveToEntities ( &clip );
657 
658  return clip.trace;
659 }
660 
entity_state_s::old_origin
vec3_t old_origin
Definition: q_shared.h:1151
SV_TraceBounds
void SV_TraceBounds(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
Definition: sv_world.c:590
areanode_s::solid_edicts
link_t solid_edicts
Definition: sv_world.c:47
sv
server_t sv
Definition: sv_init.c:24
edict_s::s
entity_state_t s
Definition: g_local.h:970
CM_BoxTrace
trace_t CM_BoxTrace(vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, int headnode, int brushmask)
Definition: cmodel.c:1350
area_maxcount
int area_maxcount
Definition: sv_world.c:58
entity_state_s::solid
int solid
Definition: q_shared.h:1158
trace_t::fraction
float fraction
Definition: q_shared.h:457
area_count
int area_count
Definition: sv_world.c:58
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:163
cmodel_s::maxs
vec3_t maxs
Definition: q_shared.h:434
edict_s::absmax
vec3_t absmax
Definition: g_local.h:991
moveclip_t::maxs
float * maxs
Definition: sv_world.c:469
SOLID_BBOX
@ SOLID_BBOX
Definition: game.h:37
v
GLdouble v
Definition: qgl_win.c:143
InsertLinkBefore
void InsertLinkBefore(link_t *l, link_t *before)
Definition: sv_world.c:76
game_export_t::edicts
struct edict_s * edicts
Definition: game.h:229
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1149
edict_s::linkcount
int linkcount
Definition: g_local.h:977
moveclip_t::passedict
edict_t * passedict
Definition: sv_world.c:473
SV_PointContents
int SV_PointContents(vec3_t p)
Definition: sv_world.c:432
moveclip_t::contentmask
int contentmask
Definition: sv_world.c:474
CONTENTS_DEADMONSTER
#define CONTENTS_DEADMONSTER
Definition: qfiles.h:360
edict_s::inuse
qboolean inuse
Definition: g_local.h:976
edict_s::areanum2
int areanum2
Definition: g_local.h:985
trace_t
Definition: q_shared.h:453
MAX_TOTAL_ENT_LEAFS
#define MAX_TOTAL_ENT_LEAFS
Definition: sv_world.c:165
i
int i
Definition: q_shared.c:305
EDICT_FROM_AREA
#define EDICT_FROM_AREA(l)
Definition: sv_world.c:39
moveclip_t::boxmins
vec3_t boxmins
Definition: sv_world.c:468
SV_HullForEntity
int SV_HullForEntity(edict_t *ent)
Definition: sv_world.c:489
CM_TransformedPointContents
int CM_TransformedPointContents(vec3_t p, int headnode, vec3_t origin, vec3_t angles)
Definition: cmodel.c:937
SV_AreaEdicts_r
void SV_AreaEdicts_r(areanode_t *node)
Definition: sv_world.c:355
SOLID_TRIGGER
@ SOLID_TRIGGER
Definition: game.h:36
area_mins
float * area_mins
Definition: sv_world.c:56
sv_numareanodes
int sv_numareanodes
Definition: sv_world.c:54
edict_s::mins
vec3_t mins
Definition: g_local.h:990
edict_s::clusternums
int clusternums[MAX_ENT_CLUSTERS]
Definition: g_local.h:983
ClearLink
void ClearLink(link_t *l)
Definition: sv_world.c:65
areanode_s::trigger_edicts
link_t trigger_edicts
Definition: sv_world.c:46
area_maxs
float * area_maxs
Definition: sv_world.c:56
edict_s::areanum
int areanum
Definition: g_local.h:985
moveclip_t::mins
float * mins
Definition: sv_world.c:469
CM_LeafArea
int CM_LeafArea(int leafnum)
Definition: cmodel.c:681
SV_AreaEdicts
int SV_AreaEdicts(vec3_t mins, vec3_t maxs, edict_t **list, int maxcount, int areatype)
Definition: sv_world.c:409
cmodel_s::headnode
int headnode
Definition: q_shared.h:436
j
GLint j
Definition: qgl_win.c:150
CM_PointContents
int CM_PointContents(vec3_t p, int headnode)
Definition: cmodel.c:917
RemoveLink
void RemoveLink(link_t *l)
Definition: sv_world.c:70
SVF_DEADMONSTER
#define SVF_DEADMONSTER
Definition: game.h:28
trace_t::allsolid
qboolean allsolid
Definition: q_shared.h:455
edict_s::svflags
int svflags
Definition: g_local.h:989
moveclip_t::trace
trace_t trace
Definition: sv_world.c:472
edict_s
Definition: g_local.h:968
moveclip_t::boxmaxs
vec3_t boxmaxs
Definition: sv_world.c:468
ge
game_export_t * ge
Definition: sv_game.c:24
area_list
edict_t ** area_list
Definition: sv_world.c:57
edict_s::owner
edict_t * owner
Definition: g_local.h:994
server_t::models
struct cmodel_s * models[MAX_MODELS]
Definition: server.h:54
cmodel_s::mins
vec3_t mins
Definition: q_shared.h:434
sv_areanodes
areanode_t sv_areanodes[AREA_NODES]
Definition: sv_world.c:53
moveclip_t::start
float * start
Definition: sv_world.c:471
NULL
#define NULL
Definition: q_shared.h:67
edict_s::solid
solid_t solid
Definition: g_local.h:992
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:181
cmodel_s
Definition: q_shared.h:432
areanode_s
Definition: sv_world.c:41
areanode_s::dist
float dist
Definition: sv_world.c:44
AREA_DEPTH
#define AREA_DEPTH
Definition: sv_world.c:50
moveclip_t::maxs2
vec3_t maxs2
Definition: sv_world.c:470
SOLID_NOT
@ SOLID_NOT
Definition: game.h:35
MAX_EDICTS
#define MAX_EDICTS
Definition: q_shared.h:87
CM_BoxLeafnums
int CM_BoxLeafnums(vec3_t mins, vec3_t maxs, int *list, int listsize, int *topnode)
Definition: cmodel.c:903
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:164
SV_ClipMoveToEntities
void SV_ClipMoveToEntities(moveclip_t *clip)
Definition: sv_world.c:518
moveclip_t::end
float * end
Definition: sv_world.c:471
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
areanode_s::axis
int axis
Definition: sv_world.c:43
areanode_t
struct areanode_s areanode_t
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
CM_HeadnodeForBox
int CM_HeadnodeForBox(vec3_t mins, vec3_t maxs)
Definition: cmodel.c:775
AREA_SOLID
#define AREA_SOLID
Definition: q_shared.h:407
AREA_NODES
#define AREA_NODES
Definition: sv_world.c:51
CM_LeafCluster
int CM_LeafCluster(int leafnum)
Definition: cmodel.c:674
SV_UnlinkEdict
void SV_UnlinkEdict(edict_t *ent)
Definition: sv_world.c:150
SOLID_BSP
@ SOLID_BSP
Definition: game.h:38
edict_s::maxs
vec3_t maxs
Definition: g_local.h:990
SV_CreateAreaNode
areanode_t * SV_CreateAreaNode(int depth, vec3_t mins, vec3_t maxs)
Definition: sv_world.c:91
trace_t::startsolid
qboolean startsolid
Definition: q_shared.h:456
SV_LinkEdict
void SV_LinkEdict(edict_t *ent)
Definition: sv_world.c:166
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1152
moveclip_t::mins2
vec3_t mins2
Definition: sv_world.c:470
SV_ClearWorld
void SV_ClearWorld(void)
Definition: sv_world.c:136
server_t::state
server_state_t state
Definition: server.h:45
trace_t::ent
struct edict_s * ent
Definition: q_shared.h:462
edict_s::num_clusters
int num_clusters
Definition: g_local.h:982
Com_DPrintf
void Com_DPrintf(char *fmt,...)
Definition: common.c:157
SVF_MONSTER
#define SVF_MONSTER
Definition: game.h:29
moveclip_t
Definition: sv_world.c:466
edict_s::headnode
int headnode
Definition: g_local.h:984
SV_Trace
trace_t SV_Trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passedict, int contentmask)
Definition: sv_world.c:625
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:104
edict_s::area
link_t area
Definition: g_local.h:980
areanode_s::children
struct areanode_s * children[2]
Definition: sv_world.c:45
server.h
CM_TransformedBoxTrace
trace_t CM_TransformedBoxTrace(vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, int headnode, int brushmask, vec3_t origin, vec3_t angles)
Definition: cmodel.c:1451
edict_s::size
vec3_t size
Definition: g_local.h:991
ss_loading
@ ss_loading
Definition: server.h:34
area_type
int area_type
Definition: sv_world.c:59
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1150
MAX_ENT_CLUSTERS
#define MAX_ENT_CLUSTERS
Definition: game.h:49
max
#define max(a, b)
Definition: vk_local.h:75
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
edict_s::absmin
vec3_t absmin
Definition: g_local.h:991
count
GLint GLsizei count
Definition: qgl_win.c:128