From: uis Date: Sat, 24 Aug 2024 17:27:35 +0000 (+0300) Subject: model_brush: don't calculate box halfsize twice X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuis%2Fopt-tracebrush;p=xonotic%2Fdarkplaces.git model_brush: don't calculate box halfsize twice --- diff --git a/model_brush.c b/model_brush.c index 69082e61..2d48e888 100644 --- a/model_brush.c +++ b/model_brush.c @@ -7097,7 +7097,7 @@ void Mod_CollisionBIH_TraceBrush(model_t *model, const frameblend_t *frameblend, const colbrushf_t *brush; const int *e; const texture_t *texture; - vec3_t start, end, startmins, startmaxs, endmins, endmaxs, mins, maxs; + vec3_t start, end, startmaxs, endmaxs, mins, maxs; vec3_t nodebigmins, nodebigmaxs, nodestart, nodeend, sweepnodemins, sweepnodemaxs; vec_t d1, d2, d3, d4, f, nodestackline[1024][6]; int axis, nodenum, nodestackpos = 0, nodestack[1024]; @@ -7128,16 +7128,12 @@ void Mod_CollisionBIH_TraceBrush(model_t *model, const frameblend_t *frameblend, VectorAdd(thisbrush_end->mins, thisbrush_end->maxs, end); VectorM(0.5f, start, start); VectorM(0.5f, end, end); - VectorSubtract(thisbrush_start->mins, start, startmins); VectorSubtract(thisbrush_start->maxs, start, startmaxs); - VectorSubtract(thisbrush_end->mins, end, endmins); VectorSubtract(thisbrush_end->maxs, end, endmaxs); - mins[0] = min(startmins[0], endmins[0]); - mins[1] = min(startmins[1], endmins[1]); - mins[2] = min(startmins[2], endmins[2]); maxs[0] = max(startmaxs[0], endmaxs[0]); maxs[1] = max(startmaxs[1], endmaxs[1]); maxs[2] = max(startmaxs[2], endmaxs[2]); + VectorNegate(maxs, mins); // push first node nodestackline[nodestackpos][0] = start[0];