- trace->realfraction = bound(0, enterfrac, 1);
- trace->fraction = bound(0, enterfrac2, 1);
- VectorCopy(newimpactnormal, trace->plane.normal);
+#if 0
+ // broken
+ if (thatbrush_start->ispolygon)
+ {
+ d1 = nearestplanedist_float(thatbrush_start->planes[0].normal, thisbrush_start->points, thisbrush_start->numpoints) - thatbrush_start->planes[0].dist - collision_startnudge.value;
+ d2 = nearestplanedist_float(thatbrush_end->planes[0].normal, thisbrush_end->points, thisbrush_end->numpoints) - thatbrush_end->planes[0].dist - collision_endnudge.value;
+ move = d1 - d2;
+ if (move <= 0 || d2 > collision_enternudge.value || d1 < 0)
+ return;
+ // enter
+ imove = 1 / move;
+ enterfrac = (d1 - collision_enternudge.value) * imove;
+ if (enterfrac < trace->realfraction)
+ {
+ enterfrac2 = enterfrac - collision_impactnudge.value * imove;
+ trace->realfraction = bound(0, enterfrac, 1);
+ trace->fraction = bound(0, enterfrac2, 1);
+ VectorLerp(thatbrush_start->planes[0].normal, enterfrac, thatbrush_end->planes[0].normal, trace->plane.normal);
+ }
+ }
+ else
+#endif
+ {
+ trace->realfraction = bound(0, enterfrac, 1);
+ trace->fraction = bound(0, enterfrac2, 1);
+ VectorCopy(newimpactnormal, trace->plane.normal);
+ }