X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=cl_collision.c;h=92d5b8dea32d782695c3324cf261ab843d6c91e4;hb=14bec1a4c2a0623c08d1e746a023971e311fda36;hp=75333083d91a694c5d48dfe4a3e18d1144318e73;hpb=8b04cb6b66ce0cad559895cd9f7e743194752d88;p=xonotic%2Fdarkplaces.git diff --git a/cl_collision.c b/cl_collision.c index 75333083..92d5b8de 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -74,7 +74,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co trace.realfraction = 1; if (ent->model && ent->model->TraceBox) - ent->model->TraceBox(ent->model, 0, &trace, start, mins, maxs, endtransformed, hitsupercontentsmask); + ent->model->TraceBox(ent->model, 0, &trace, starttransformed, mins, maxs, endtransformed, hitsupercontentsmask); // LordHavoc: take the 'best' answers from the new trace and combine with existing data if (trace.allsolid) @@ -137,7 +137,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co Matrix4x4_Transform(&ent->inversematrix, start, starttransformed); Matrix4x4_Transform(&ent->inversematrix, end, endtransformed); - Collision_ClipTrace_Box(&trace, playermins, playermaxs, starttransformed, mins, maxs, endtransformed, hitsupercontentsmask, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY, 0, NULL); + Collision_ClipTrace_Box(&trace, playermins, playermaxs, starttransformed, mins, maxs, endtransformed, hitsupercontentsmask, SUPERCONTENTS_BODY, 0, NULL); // LordHavoc: take the 'best' answers from the new trace and combine with existing data if (trace.allsolid) @@ -178,12 +178,10 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co return cliptrace; } -float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent, entity_render_t *ignoreent, qboolean csqcents) +float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent, entity_render_t *ignoreent) { float maxfrac, maxrealfrac; - int n, entsnum; - entity_t *entlist; - unsigned char *entactivelist; + int n; entity_render_t *ent; float tracemins[3], tracemaxs[3]; trace_t trace; @@ -197,7 +195,7 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve if (hitent) *hitent = 0; if (cl.worldmodel && cl.worldmodel->TraceBox) - cl.worldmodel->TraceBox(cl.worldmodel, 0, &trace, start, vec3_origin, vec3_origin, end, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY); + cl.worldmodel->TraceBox(cl.worldmodel, 0, &trace, start, vec3_origin, vec3_origin, end, SUPERCONTENTS_SOLID); if (normal) VectorCopy(trace.plane.normal, normal); @@ -211,25 +209,12 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve tracemins[2] = min(start[2], end[2]); tracemaxs[2] = max(start[2], end[2]); - if(csqcents) - { - entlist = cl.csqcentities; - entactivelist = cl.csqcentities_active; - entsnum = cl.num_csqcentities; - } - else - { - entlist = cl.entities; - entactivelist = cl.entities_active; - entsnum = cl.num_entities; - } - // look for embedded bmodels - for (n = 0;n < entsnum;n++) + for (n = 0;n < cl.num_entities;n++) { - if (!entactivelist[n]) + if (!cl.entities_active[n]) continue; - ent = &entlist[n].render; + ent = &cl.entities[n].render; if (!BoxesOverlap(ent->mins, ent->maxs, tracemins, tracemaxs)) continue; if (!ent->model || !ent->model->TraceBox) @@ -237,15 +222,15 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve if ((ent->flags & RENDER_EXTERIORMODEL) && !chase_active.integer) continue; // if transparent and not selectable, skip entity - if (!(entlist[n].state_current.effects & EF_SELECTABLE) && (ent->alpha < 1 || (ent->effects & (EF_ADDITIVE | EF_NODEPTHTEST)))) + if (!(cl.entities[n].state_current.effects & EF_SELECTABLE) && (ent->alpha < 1 || (ent->effects & (EF_ADDITIVE | EF_NODEPTHTEST)))) continue; if (ent == ignoreent) continue; Matrix4x4_Transform(&ent->inversematrix, start, starttransformed); Matrix4x4_Transform(&ent->inversematrix, end, endtransformed); - if (ent->model && ent->model->TraceBox) - ent->model->TraceBox(ent->model, ent->frameblend[0].frame, &trace, starttransformed, vec3_origin, vec3_origin, endtransformed, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY); + //if (ent->model && ent->model->TraceBox) + ent->model->TraceBox(ent->model, ent->frameblend[0].frame, &trace, starttransformed, vec3_origin, vec3_origin, endtransformed, SUPERCONTENTS_SOLID); if (maxrealfrac > trace.realfraction) { @@ -275,25 +260,8 @@ void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius) cl.worldmodel->brush.FindNonSolidLocation(cl.worldmodel, in, out, radius); } -int CL_PointQ1Contents(const vec3_t p) -{ - return Mod_Q1BSP_NativeContentsFromSuperContents(NULL, CL_TraceBox(p, vec3_origin, vec3_origin, p, true, NULL, 0, false).startsupercontents); - /* - // FIXME: check multiple brush models - if (cl.worldmodel && cl.worldmodel->brush.PointContentsQ1) - return cl.worldmodel->brush.PointContentsQ1(cl.worldmodel, p); - return 0; - */ -} - int CL_PointSuperContents(const vec3_t p) { return CL_TraceBox(p, vec3_origin, vec3_origin, p, true, NULL, 0, false).startsupercontents; - /* - // FIXME: check multiple brush models - if (cl.worldmodel && cl.worldmodel->brush.PointContentsQ1) - return cl.worldmodel->brush.PointContentsQ1(cl.worldmodel, p); - return 0; - */ }