VectorCopy (plane->normal, t->trace->plane.normal);
}
- // calculate the true fraction
+ // calculate the return fraction which is nudged off the surface a bit
t1 = DotProduct(t->trace->plane.normal, t->start) - t->trace->plane.dist;
t2 = DotProduct(t->trace->plane.normal, t->end) - t->trace->plane.dist;
- midf = t1 / (t1 - t2);
- t->trace->realfraction = bound(0, midf, 1);
-
- // calculate the return fraction which is nudged off the surface a bit
midf = (t1 - collision_impactnudge.value) / (t1 - t2);
t->trace->fraction = bound(0, midf, 1);
- if (collision_prefernudgedfraction.integer)
- t->trace->realfraction = t->trace->fraction;
-
#if COLLISIONPARANOID >= 3
Con_Print("D");
#endif
memset(trace, 0, sizeof(trace_t));
rhc.trace = trace;
rhc.trace->fraction = 1;
- rhc.trace->realfraction = 1;
rhc.trace->allsolid = true;
rhc.hull = &model->brushq1.hulls[0]; // 0x0x0
VectorCopy(start, rhc.start);
rhc.trace = trace;
rhc.trace->hitsupercontentsmask = hitsupercontentsmask;
rhc.trace->fraction = 1;
- rhc.trace->realfraction = 1;
rhc.trace->allsolid = true;
rhc.hull = &model->brushq1.hulls[0]; // 0x0x0
VectorCopy(start, rhc.start);
rhc.trace = &testtrace;
rhc.trace->hitsupercontentsmask = hitsupercontentsmask;
rhc.trace->fraction = 1;
- rhc.trace->realfraction = 1;
rhc.trace->allsolid = true;
VectorCopy(test, rhc.start);
VectorCopy(test, rhc.end);
rhc.trace = trace;
rhc.trace->hitsupercontentsmask = hitsupercontentsmask;
rhc.trace->fraction = 1;
- rhc.trace->realfraction = 1;
rhc.trace->allsolid = true;
VectorSubtract(boxmaxs, boxmins, boxsize);
if (boxsize[0] < 3)
rhc.trace = &testtrace;
rhc.trace->hitsupercontentsmask = hitsupercontentsmask;
rhc.trace->fraction = 1;
- rhc.trace->realfraction = 1;
rhc.trace->allsolid = true;
VectorCopy(test, rhc.start);
VectorCopy(test, rhc.end);
memset(trace, 0, sizeof(trace_t));
trace->hitsupercontentsmask = hitsupercontentsmask;
trace->fraction = 1;
- trace->realfraction = 1;
Collision_TraceLineBrushFloat(trace, start, end, &cbox, &cbox);
#else
RecursiveHullCheckTraceInfo_t rhc;
rhc.trace = trace;
rhc.trace->hitsupercontentsmask = hitsupercontentsmask;
rhc.trace->fraction = 1;
- rhc.trace->realfraction = 1;
rhc.trace->allsolid = true;
VectorCopy(start, rhc.start);
VectorCopy(end, rhc.end);
{
memset(trace, 0, sizeof(trace_t));
trace->fraction = 1;
- trace->realfraction = 1;
if (BoxesOverlap(start, start, cmins, cmaxs))
{
trace->startsupercontents |= boxsupercontents;
VectorCopy(normal, t->trace->plane.normal);
t->trace->plane.dist = DotProduct(normal, p);
- // calculate the true fraction
+ // calculate the return fraction which is nudged off the surface a bit
t1 = DotProduct(t->start, t->trace->plane.normal) - t->trace->plane.dist;
t2 = DotProduct(t->end, t->trace->plane.normal) - t->trace->plane.dist;
- midf = t1 / (t1 - t2);
- t->trace->realfraction = midf;
-
- // calculate the return fraction which is nudged off the surface a bit
midf = (t1 - collision_impactnudge.value) / (t1 - t2);
t->trace->fraction = bound(0, midf, 1);
- if (collision_prefernudgedfraction.integer)
- t->trace->realfraction = t->trace->fraction;
-
t->trace->hittexture = surface->texture->currentframe;
t->trace->hitq3surfaceflags = t->trace->hittexture->surfaceflags;
t->trace->hitsupercontents = t->trace->hittexture->supercontents;
rhc.trace = trace;
rhc.trace->hitsupercontentsmask = hitsupercontentsmask;
rhc.trace->fraction = 1;
- rhc.trace->realfraction = 1;
rhc.trace->allsolid = true;
rhc.hull = &model->brushq1.hulls[0]; // 0x0x0
VectorCopy(start, rhc.start);
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
bih = &model->collision_bih;
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
// push first node
// box trace, performed as brush trace
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
// calculate tracebox-like parameters for efficient culling
#endif
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
#if 0
Mod_CollisionBIH_TraceLine(model, frameblend, skeleton, trace, start, end, hitsupercontentsmask);
hitsupercontents = trace->hitsupercontents;
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
trace->startsupercontents = hitsupercontents;
#endif
VectorSet(end, start[0], start[1], model->normalmins[2]);
memset(&trace, 0, sizeof(trace));
trace.fraction = 1;
- trace.realfraction = 1;
trace.hitsupercontentsmask = 0;
Mod_CollisionBIH_TraceLine(model, frameblend, skeleton, trace, start, end, hitsupercontentsmask);
return trace.hitsupercontents;
Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace, model, node->children[startside], start, mid, startfrac, midfrac, linestart, lineend, markframe, segmentmins, segmentmaxs);
// if we found an impact on the front side, don't waste time
// exploring the far side
- if (midfrac <= trace->realfraction)
+ if (midfrac <= trace->fraction)
Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace, model, node->children[endside], mid, end, midfrac, endfrac, linestart, lineend, markframe, segmentmins, segmentmaxs);
return;
}
q3mbrush_t *brush;
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
if (mod_collision_bih.integer)
Mod_CollisionBIH_TracePoint(model, frameblend, skeleton, trace, start, hitsupercontentsmask);
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
segmentmins[0] = min(start[0], end[0]) - 1;
segmentmins[1] = min(start[1], end[1]) - 1;
// box trace, performed as brush trace
memset(trace, 0, sizeof(*trace));
trace->fraction = 1;
- trace->realfraction = 1;
trace->hitsupercontentsmask = hitsupercontentsmask;
segmentmins[0] = min(start->mins[0], end->mins[0]) - 1;
segmentmins[1] = min(start->mins[1], end->mins[1]) - 1;