2 Copyright (C) 1996-1997 Id Software, Inc.
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.
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.
13 See the GNU General Public License for more details.
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.
20 // world.c -- world query functions
26 entities never clip against themselves, or their owner
28 line of sight checks trace->crosscontent, but bullets don't
35 struct link_s *prev, *next;
40 void ClearLink (link_t *l);
41 void RemoveLink (link_t *l);
42 void InsertLinkBefore (link_t *l, link_t *before);
43 void InsertLinkAfter (link_t *l, link_t *after);
45 // (type *)STRUCT_FROM_LINK(link_t *link, type, member)
46 // ent = STRUCT_FROM_LINK(link,entity_t,order)
47 // FIXME: remove this mess!
48 //#define STRUCT_FROM_LINK(l,t,m) ((t *)((qbyte *)l - (int)&(((t *)0)->m)))
50 #define EDICT_FROM_AREA(l) ((edict_t *)((qbyte *)l - (int)&(((edict_t *)0)->area)))
52 //============================================================================
54 // ClearLink is used for new headnodes
55 void ClearLink (link_t *l)
57 l->prev = l->next = l;
60 void RemoveLink (link_t *l)
62 l->next->prev = l->prev;
63 l->prev->next = l->next;
66 void InsertLinkBefore (link_t *l, link_t *before)
69 l->prev = before->prev;
73 void InsertLinkAfter (link_t *l, link_t *after)
75 l->next = after->next;
84 vec3_t boxmins, boxmaxs;// enclose the test object along entire move
85 float *mins, *maxs; // size of the moving object
86 vec3_t mins2, maxs2; // size when clipping against mosnters
95 ===============================================================================
99 ===============================================================================
103 static hull_t box_hull;
104 static dclipnode_t box_clipnodes[6];
105 static mplane_t box_planes[6];
111 Set up the planes and clipnodes so that the six floats of a bounding box
112 can just be stored out and get a proper hull_t structure.
115 void SV_InitBoxHull (void)
120 box_hull.clipnodes = box_clipnodes;
121 box_hull.planes = box_planes;
122 box_hull.firstclipnode = 0;
123 box_hull.lastclipnode = 5;
125 for (i=0 ; i<6 ; i++)
127 box_clipnodes[i].planenum = i;
131 box_clipnodes[i].children[side] = CONTENTS_EMPTY;
133 box_clipnodes[i].children[side^1] = i + 1;
135 box_clipnodes[i].children[side^1] = CONTENTS_SOLID;
137 box_planes[i].type = i>>1;
138 box_planes[i].normal[i>>1] = 1;
147 To keep everything totally uniform, bounding boxes are turned into small
148 BSP trees instead of being compared directly.
151 hull_t *SV_HullForBox (vec3_t mins, vec3_t maxs)
153 box_planes[0].dist = maxs[0];
154 box_planes[1].dist = mins[0];
155 box_planes[2].dist = maxs[1];
156 box_planes[3].dist = mins[1];
157 box_planes[4].dist = maxs[2];
158 box_planes[5].dist = mins[2];
169 Returns a hull that can be used for testing or clipping an object of mins/maxs
171 Offset is filled in to contain the adjustment that must be added to the
172 testing object's origin to get a point to use with the returned hull.
175 hull_t *SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
179 vec3_t hullmins, hullmaxs;
182 // decide which clipping hull to use, based on the size
183 if (ent->v.solid == SOLID_BSP)
184 { // explicit hulls in the BSP model
185 if (ent->v.movetype != MOVETYPE_PUSH)
186 Host_Error ("SOLID_BSP without MOVETYPE_PUSH");
188 model = sv.models[ (int)ent->v.modelindex ];
189 Mod_CheckLoaded(model);
191 // LordHavoc: fixed SOLID_BSP error message
192 if (!model || model->type != mod_brush)
194 Con_Printf ("SOLID_BSP with a non bsp model, entity dump:\n");
196 Host_Error ("SOLID_BSP with a non bsp model\n");
199 VectorSubtract (maxs, mins, size);
200 // LordHavoc: FIXME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
201 if (sv.worldmodel->ishlbsp)
204 hull = &model->hulls[0]; // 0x0x0
205 else if (size[0] <= 32)
207 if (size[2] < 54) // pick the nearest of 36 or 72
208 hull = &model->hulls[3]; // 32x32x36
210 hull = &model->hulls[1]; // 32x32x72
213 hull = &model->hulls[2]; // 64x64x64
218 hull = &model->hulls[0]; // 0x0x0
219 else if (size[0] <= 32)
220 hull = &model->hulls[1]; // 32x32x56
222 hull = &model->hulls[2]; // 64x64x88
225 // calculate an offset value to center the origin
226 VectorSubtract (hull->clip_mins, mins, offset);
227 VectorAdd (offset, ent->v.origin, offset);
230 { // create a temp hull from bounding box sizes
232 VectorSubtract (ent->v.mins, maxs, hullmins);
233 VectorSubtract (ent->v.maxs, mins, hullmaxs);
234 hull = SV_HullForBox (hullmins, hullmaxs);
236 VectorCopy (ent->v.origin, offset);
244 ===============================================================================
248 ===============================================================================
251 typedef struct areanode_s
253 int axis; // -1 = leaf node
255 struct areanode_s *children[2];
256 link_t trigger_edicts;
261 #define AREA_NODES 32
263 static areanode_t sv_areanodes[AREA_NODES];
264 static int sv_numareanodes;
272 areanode_t *SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs)
276 vec3_t mins1, maxs1, mins2, maxs2;
278 anode = &sv_areanodes[sv_numareanodes];
281 ClearLink (&anode->trigger_edicts);
282 ClearLink (&anode->solid_edicts);
284 if (depth == AREA_DEPTH)
287 anode->children[0] = anode->children[1] = NULL;
291 VectorSubtract (maxs, mins, size);
292 if (size[0] > size[1])
297 anode->dist = 0.5 * (maxs[anode->axis] + mins[anode->axis]);
298 VectorCopy (mins, mins1);
299 VectorCopy (mins, mins2);
300 VectorCopy (maxs, maxs1);
301 VectorCopy (maxs, maxs2);
303 maxs1[anode->axis] = mins2[anode->axis] = anode->dist;
305 anode->children[0] = SV_CreateAreaNode (depth+1, mins2, maxs2);
306 anode->children[1] = SV_CreateAreaNode (depth+1, mins1, maxs1);
317 void SV_ClearWorld (void)
321 memset (sv_areanodes, 0, sizeof(sv_areanodes));
323 Mod_CheckLoaded(sv.worldmodel);
324 SV_CreateAreaNode (0, sv.worldmodel->normalmins, sv.worldmodel->normalmaxs);
334 void SV_UnlinkEdict (edict_t *ent)
337 return; // not linked in anywhere
338 RemoveLink (&ent->area);
339 ent->area.prev = ent->area.next = NULL;
348 void SV_TouchLinks ( edict_t *ent, areanode_t *node )
352 int old_self, old_other;
355 // touch linked edicts
356 for (l = node->trigger_edicts.next ; l != &node->trigger_edicts ; l = next)
359 touch = EDICT_FROM_AREA(l);
362 if (!touch->v.touch || touch->v.solid != SOLID_TRIGGER)
364 if (ent->v.absmin[0] > touch->v.absmax[0]
365 || ent->v.absmin[1] > touch->v.absmax[1]
366 || ent->v.absmin[2] > touch->v.absmax[2]
367 || ent->v.absmax[0] < touch->v.absmin[0]
368 || ent->v.absmax[1] < touch->v.absmin[1]
369 || ent->v.absmax[2] < touch->v.absmin[2])
371 old_self = pr_global_struct->self;
372 old_other = pr_global_struct->other;
374 pr_global_struct->self = EDICT_TO_PROG(touch);
375 pr_global_struct->other = EDICT_TO_PROG(ent);
376 pr_global_struct->time = sv.time;
377 PR_ExecuteProgram (touch->v.touch, "");
379 pr_global_struct->self = old_self;
380 pr_global_struct->other = old_other;
383 // recurse down both sides
384 if (node->axis == -1)
387 // LordHavoc: optimized recursion
388 // if (ent->v.absmax[node->axis] > node->dist) SV_TouchLinks (ent, node->children[0]);
389 // if (ent->v.absmin[node->axis] < node->dist) SV_TouchLinks (ent, node->children[1]);
390 if (ent->v.absmax[node->axis] > node->dist)
392 if (ent->v.absmin[node->axis] < node->dist)
393 SV_TouchLinks(ent, node->children[1]); // order reversed to reduce code
394 node = node->children[0];
399 if (ent->v.absmin[node->axis] < node->dist)
401 node = node->children[1];
414 void SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
419 SV_UnlinkEdict (ent); // unlink from old position
421 if (ent == sv.edicts)
422 return; // don't add the world
429 // LordHavoc: enabling rotating bmodels
430 if (ent->v.solid == SOLID_BSP && (ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]))
432 // expand for rotation
436 max = DotProduct(ent->v.mins, ent->v.mins);
437 v = DotProduct(ent->v.maxs, ent->v.maxs);
443 for (i=0 ; i<3 ; i++)
445 v = fabs(ent->v.mins[i]);
448 v = fabs(ent->v.maxs[i]);
453 for (i=0 ; i<3 ; i++)
455 ent->v.absmin[i] = ent->v.origin[i] - max;
456 ent->v.absmax[i] = ent->v.origin[i] + max;
461 VectorAdd (ent->v.origin, ent->v.mins, ent->v.absmin);
462 VectorAdd (ent->v.origin, ent->v.maxs, ent->v.absmax);
466 // to make items easier to pick up and allow them to be grabbed off
467 // of shelves, the abs sizes are expanded
469 if ((int)ent->v.flags & FL_ITEM)
471 ent->v.absmin[0] -= 15;
472 ent->v.absmin[1] -= 15;
473 ent->v.absmax[0] += 15;
474 ent->v.absmax[1] += 15;
478 // because movement is clipped an epsilon away from an actual edge,
479 // we must fully check even when bounding boxes don't quite touch
480 ent->v.absmin[0] -= 1;
481 ent->v.absmin[1] -= 1;
482 ent->v.absmin[2] -= 1;
483 ent->v.absmax[0] += 1;
484 ent->v.absmax[1] += 1;
485 ent->v.absmax[2] += 1;
488 if (ent->v.solid == SOLID_NOT)
491 // find the first node that the ent's box crosses
495 if (node->axis == -1)
497 if (ent->v.absmin[node->axis] > node->dist)
498 node = node->children[0];
499 else if (ent->v.absmax[node->axis] < node->dist)
500 node = node->children[1];
502 break; // crosses the node
507 if (ent->v.solid == SOLID_TRIGGER)
508 InsertLinkBefore (&ent->area, &node->trigger_edicts);
510 InsertLinkBefore (&ent->area, &node->solid_edicts);
512 // if touch_triggers, touch all entities at this node and descend for more
514 SV_TouchLinks ( ent, sv_areanodes );
520 ===============================================================================
522 POINT TESTING IN HULLS
524 ===============================================================================
533 int SV_HullPointContents (hull_t *hull, int num, vec3_t p)
536 num = hull->clipnodes[num].children[(hull->planes[hull->clipnodes[num].planenum].type < 3 ? p[hull->planes[hull->clipnodes[num].planenum].type] : DotProduct (hull->planes[hull->clipnodes[num].planenum].normal, p)) < hull->planes[hull->clipnodes[num].planenum].dist];
543 SV_TestEntityPosition
545 This could be a lot more efficient...
548 edict_t *SV_TestEntityPosition (edict_t *ent)
552 trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL, ent);
554 if (trace.startsolid)
562 ===============================================================================
564 LINE TESTING IN HULLS
566 ===============================================================================
569 // 1/32 epsilon to keep floating point happy
570 #define DIST_EPSILON (0.03125)
572 #define HULLCHECKSTATE_EMPTY 0
573 #define HULLCHECKSTATE_SOLID 1
574 #define HULLCHECKSTATE_DONE 2
576 // LordHavoc: FIXME: this is not thread safe, if threading matters here, pass
577 // this as a struct to RecursiveHullCheck, RecursiveHullCheck_Impact, etc...
578 RecursiveHullCheckTraceInfo_t RecursiveHullCheckInfo;
579 #define RHC RecursiveHullCheckInfo
581 void SV_RecursiveHullCheck_Impact (mplane_t *plane, int side)
583 // LordHavoc: using doubles for extra accuracy
586 // LordHavoc: now that we have found the impact, recalculate the impact
587 // point from scratch for maximum accuracy, with an epsilon bias on the
592 frac -= DIST_EPSILON;
593 VectorNegate (plane->normal, RHC.trace->plane.normal);
594 RHC.trace->plane.dist = -plane->dist;
598 frac += DIST_EPSILON;
599 VectorCopy (plane->normal, RHC.trace->plane.normal);
600 RHC.trace->plane.dist = plane->dist;
605 t1 = RHC.start[plane->type] - frac;
606 t2 = RHC.start[plane->type] + RHC.dist[plane->type] - frac;
610 t1 = plane->normal[0] * RHC.start[0] + plane->normal[1] * RHC.start[1] + plane->normal[2] * RHC.start[2] - frac;
611 t2 = plane->normal[0] * (RHC.start[0] + RHC.dist[0]) + plane->normal[1] * (RHC.start[1] + RHC.dist[1]) + plane->normal[2] * (RHC.start[2] + RHC.dist[2]) - frac;
614 frac = t1 / (t1 - t2);
615 frac = bound(0.0f, frac, 1.0);
617 RHC.trace->fraction = frac;
618 RHC.trace->endpos[0] = RHC.start[0] + frac * RHC.dist[0];
619 RHC.trace->endpos[1] = RHC.start[1] + frac * RHC.dist[1];
620 RHC.trace->endpos[2] = RHC.start[2] + frac * RHC.dist[2];
623 int SV_RecursiveHullCheck (int num, double p1f, double p2f, double p1[3], double p2[3])
628 // LordHavoc: FIXME: this is not thread safe... if threading matters here,
629 // remove the static prefixes
631 static mplane_t *plane;
632 static double t1, t2, frac;
634 // LordHavoc: a goto! everyone flee in terror... :)
639 RHC.trace->endcontents = num;
640 if (RHC.trace->startcontents)
642 if (num == RHC.trace->startcontents)
643 RHC.trace->allsolid = false;
646 // if the first leaf is solid, set startsolid
647 if (RHC.trace->allsolid)
648 RHC.trace->startsolid = true;
649 return HULLCHECKSTATE_SOLID;
651 return HULLCHECKSTATE_EMPTY;
655 if (num != CONTENTS_SOLID)
657 RHC.trace->allsolid = false;
658 if (num == CONTENTS_EMPTY)
659 RHC.trace->inopen = true;
661 RHC.trace->inwater = true;
665 // if the first leaf is solid, set startsolid
666 if (RHC.trace->allsolid)
667 RHC.trace->startsolid = true;
668 return HULLCHECKSTATE_SOLID;
670 return HULLCHECKSTATE_EMPTY;
674 // find the point distances
675 node = RHC.hull->clipnodes + num;
677 plane = RHC.hull->planes + node->planenum;
680 t1 = p1[plane->type] - plane->dist;
681 t2 = p2[plane->type] - plane->dist;
685 t1 = DotProduct (plane->normal, p1) - plane->dist;
686 t2 = DotProduct (plane->normal, p2) - plane->dist;
689 // LordHavoc: rearranged the side/frac code
694 num = node->children[0];
697 // put the crosspoint DIST_EPSILON pixels on the near side
704 num = node->children[1];
707 // put the crosspoint DIST_EPSILON pixels on the near side
711 frac = t1 / (t1 - t2);
712 frac = bound(0.0f, frac, 1.0);
714 midf = p1f + ((p2f - p1f) * frac);
715 mid[0] = RHC.start[0] + midf * RHC.dist[0];
716 mid[1] = RHC.start[1] + midf * RHC.dist[1];
717 mid[2] = RHC.start[2] + midf * RHC.dist[2];
720 ret = SV_RecursiveHullCheck (node->children[side], p1f, midf, p1, mid);
721 if (ret != HULLCHECKSTATE_EMPTY)
722 return ret; // solid or done
723 ret = SV_RecursiveHullCheck (node->children[!side], midf, p2f, mid, p2);
724 if (ret != HULLCHECKSTATE_SOLID)
725 return ret; // empty or done
727 // front is air and back is solid, this is the impact point...
728 SV_RecursiveHullCheck_Impact(RHC.hull->planes + node->planenum, side);
730 return HULLCHECKSTATE_DONE;
737 Handles selection or creation of a clipping hull, and offseting (and
738 eventually rotation) of the end points
741 trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
744 vec3_t offset, forward, left, up;
745 double startd[3], endd[3], tempd[3];
748 // fill in a default trace
749 memset (&trace, 0, sizeof(trace_t));
751 trace.allsolid = true;
753 // get the clipping hull
754 hull = SV_HullForEntity (ent, mins, maxs, offset);
756 VectorSubtract(start, offset, startd);
757 VectorSubtract(end, offset, endd);
759 // rotate start and end into the models frame of reference
760 if (ent->v.solid == SOLID_BSP && (ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]))
762 AngleVectorsFLU (ent->v.angles, forward, left, up);
763 VectorCopy(startd, tempd);
764 startd[0] = DotProduct (tempd, forward);
765 startd[1] = DotProduct (tempd, left);
766 startd[2] = DotProduct (tempd, up);
767 VectorCopy(endd, tempd);
768 endd[0] = DotProduct (tempd, forward);
769 endd[1] = DotProduct (tempd, left);
770 endd[2] = DotProduct (tempd, up);
773 VectorCopy(end, trace.endpos);
775 // trace a line through the appropriate clipping hull
776 VectorCopy(startd, RecursiveHullCheckInfo.start);
777 VectorSubtract(endd, startd, RecursiveHullCheckInfo.dist);
778 RecursiveHullCheckInfo.hull = hull;
779 RecursiveHullCheckInfo.trace = &trace;
780 SV_RecursiveHullCheck (hull->firstclipnode, 0, 1, startd, endd);
782 // if we hit, unrotate endpos and normal, and store the entity we hit
783 if (trace.fraction != 1)
785 // rotate endpos back to world frame of reference
786 if (ent->v.solid == SOLID_BSP && (ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]))
788 VectorNegate (ent->v.angles, offset);
789 AngleVectorsFLU (offset, forward, left, up);
791 VectorCopy (trace.endpos, tempd);
792 trace.endpos[0] = DotProduct (tempd, forward);
793 trace.endpos[1] = DotProduct (tempd, left);
794 trace.endpos[2] = DotProduct (tempd, up);
796 VectorCopy (trace.plane.normal, tempd);
797 trace.plane.normal[0] = DotProduct (tempd, forward);
798 trace.plane.normal[1] = DotProduct (tempd, left);
799 trace.plane.normal[2] = DotProduct (tempd, up);
802 VectorAdd (trace.endpos, offset, trace.endpos);
805 else if (trace.allsolid || trace.startsolid)
811 //===========================================================================
817 Mins and maxs enclose the entire area swept by the move
820 void SV_ClipToLinks ( areanode_t *node, moveclip_t *clip )
827 if (clip->trace.allsolid)
829 // touch linked edicts
830 for (l = node->solid_edicts.next ; l != &node->solid_edicts ; l = next)
833 touch = EDICT_FROM_AREA(l);
834 if (touch->v.solid == SOLID_NOT)
836 if (touch == clip->passedict)
838 if (touch->v.solid == SOLID_TRIGGER)
839 Host_Error ("Trigger in clipping list");
841 if (clip->type == MOVE_NOMONSTERS && touch->v.solid != SOLID_BSP)
844 // LordHavoc: only do bbox check if it is a bbox entity
845 if (touch->v.solid != SOLID_BSP
846 && (clip->boxmins[0] > touch->v.absmax[0]
847 || clip->boxmaxs[0] < touch->v.absmin[0]
848 || clip->boxmins[1] > touch->v.absmax[1]
849 || clip->boxmaxs[1] < touch->v.absmin[1]
850 || clip->boxmins[2] > touch->v.absmax[2]
851 || clip->boxmaxs[2] < touch->v.absmin[2]))
856 if (clip->passedict->v.size[0] && !touch->v.size[0])
857 continue; // points never interact
858 if (PROG_TO_EDICT(touch->v.owner) == clip->passedict)
859 continue; // don't clip against own missiles
860 if (PROG_TO_EDICT(clip->passedict->v.owner) == touch)
861 continue; // don't clip against owner
862 // LordHavoc: corpse code
863 if (clip->passedict->v.solid == SOLID_CORPSE && (touch->v.solid == SOLID_SLIDEBOX || touch->v.solid == SOLID_CORPSE))
865 if (clip->passedict->v.solid == SOLID_SLIDEBOX && touch->v.solid == SOLID_CORPSE)
869 // might interact, so do an exact clip
870 if ((int)touch->v.flags & FL_MONSTER)
871 trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins2, clip->maxs2, clip->end);
873 trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins, clip->maxs, clip->end);
874 // LordHavoc: take the 'best' answers from the new trace and combine with existing data
876 clip->trace.allsolid = true;
877 if (trace.startsolid)
879 clip->trace.startsolid = true;
880 if (!clip->trace.ent)
881 clip->trace.ent = trace.ent;
884 clip->trace.inopen = true;
886 clip->trace.inwater = true;
887 if (trace.fraction < clip->trace.fraction)
889 clip->trace.fraction = trace.fraction;
890 VectorCopy(trace.endpos, clip->trace.endpos);
891 clip->trace.plane = trace.plane;
892 clip->trace.endcontents = trace.endcontents;
893 clip->trace.ent = trace.ent;
901 if (trace.startsolid || trace.fraction < clip->trace.fraction)
903 if (clip->trace.startsolid)
906 clip->trace.startsolid = true;
914 // recurse down both sides
915 if (node->axis == -1)
918 // LordHavoc: optimized recursion
919 // if (clip->boxmaxs[node->axis] > node->dist) SV_ClipToLinks(node->children[0], clip);
920 // if (clip->boxmins[node->axis] < node->dist) SV_ClipToLinks(node->children[1], clip);
921 if (clip->boxmaxs[node->axis] > node->dist)
923 if (clip->boxmins[node->axis] < node->dist)
924 SV_ClipToLinks(node->children[1], clip);
925 node = node->children[0];
928 else if (clip->boxmins[node->axis] < node->dist)
930 node = node->children[1];
941 void SV_MoveBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
944 // debug to test against everything
945 boxmins[0] = boxmins[1] = boxmins[2] = -9999;
946 boxmaxs[0] = boxmaxs[1] = boxmaxs[2] = 9999;
950 for (i=0 ; i<3 ; i++)
952 if (end[i] > start[i])
954 boxmins[i] = start[i] + mins[i] - 1;
955 boxmaxs[i] = end[i] + maxs[i] + 1;
959 boxmins[i] = end[i] + mins[i] - 1;
960 boxmaxs[i] = start[i] + maxs[i] + 1;
971 trace_t SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, edict_t *passedict)
976 memset ( &clip, 0, sizeof ( moveclip_t ) );
983 clip.passedict = passedict;
985 if (type == MOVE_MISSILE)
987 for (i=0 ; i<3 ; i++)
995 VectorCopy (clip.mins, clip.mins2);
996 VectorCopy (clip.maxs, clip.maxs2);
1000 clip.trace = SV_ClipMoveToEntity (sv.edicts, start, mins, maxs, end);
1003 //if (!clip.trace.allsolid)
1005 // create the bounding box of the entire move
1006 SV_MoveBounds ( start, clip.mins2, clip.maxs2, end, clip.boxmins, clip.boxmaxs );
1008 SV_ClipToLinks ( sv_areanodes, &clip );