]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
cl_prydoncursor traces now trace against the model bounding box before
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 25 Dec 2007 02:48:38 +0000 (02:48 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 25 Dec 2007 02:48:38 +0000 (02:48 +0000)
testing the geometry itself, this gives a substantial speed increase in
maps with lots of monsters

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7855 d7cf8633-e32d-0410-b094-e92efae38249

cl_collision.c

index e4f0c36fdcb5d7269aa6f4d0f5d03dffb464b8a1..527acecc4cb08298721dd2a833b7179df022c30c 100644 (file)
@@ -52,6 +52,9 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve
                        continue;
                Matrix4x4_Transform(&ent->inversematrix, start, starttransformed);
                Matrix4x4_Transform(&ent->inversematrix, end, endtransformed);
+               Collision_ClipTrace_Box(&trace, ent->model->normalmins, ent->model->normalmaxs, starttransformed, vec3_origin, vec3_origin, endtransformed, SUPERCONTENTS_SOLID, SUPERCONTENTS_SOLID, 0, NULL);
+               if (maxrealfrac < trace.realfraction)
+                       continue;
 
                //if (ent->model && ent->model->TraceBox)
                        ent->model->TraceBox(ent->model, ent->frameblend[0].frame, &trace, starttransformed, vec3_origin, vec3_origin, endtransformed, SUPERCONTENTS_SOLID);