From: havoc Date: Tue, 25 Dec 2007 02:48:38 +0000 (+0000) Subject: cl_prydoncursor traces now trace against the model bounding box before X-Git-Tag: xonotic-v0.1.0preview~2636 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=513ec7d1276d928ea02b349f7b9e9f37c6e0be84;p=xonotic%2Fdarkplaces.git cl_prydoncursor traces now trace against the model bounding box before 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 --- diff --git a/cl_collision.c b/cl_collision.c index e4f0c36f..527acecc 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -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);