- vec3_t forward, right, up;
- vec3_t temp;
-
- AngleVectors (ent->v.angles, forward, right, up);
-
- VectorCopy (start_l, temp);
- start_l[0] = DotProduct (temp, forward);
- start_l[1] = -DotProduct (temp, right);
- start_l[2] = DotProduct (temp, up);
-
- VectorCopy (end_l, temp);
- end_l[0] = DotProduct (temp, forward);
- end_l[1] = -DotProduct (temp, right);
- end_l[2] = DotProduct (temp, up);
- }
-
-// trace a line through the apropriate clipping hull
- SV_RecursiveHullCheck (hull, hull->firstclipnode, 0, 1, start_l, end_l, &trace);
-
-// LordHavoc: enabling rotating bmodels
- // rotate endpos back to world frame of reference
- if (ent->v.solid == SOLID_BSP &&
- (ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]) )
+ AngleVectorsFLU (ent->v.angles, forward, left, up);
+ VectorCopy(startd, tempd);
+ startd[0] = DotProduct (tempd, forward);
+ startd[1] = DotProduct (tempd, left);
+ startd[2] = DotProduct (tempd, up);
+ VectorCopy(endd, tempd);
+ endd[0] = DotProduct (tempd, forward);
+ endd[1] = DotProduct (tempd, left);
+ endd[2] = DotProduct (tempd, up);
+ }
+
+ VectorCopy(end, trace.endpos);
+
+// trace a line through the appropriate clipping hull
+ VectorCopy(startd, RecursiveHullCheckInfo.start);
+ VectorSubtract(endd, startd, RecursiveHullCheckInfo.dist);
+ RecursiveHullCheckInfo.hull = hull;
+ RecursiveHullCheckInfo.trace = &trace;
+ SV_RecursiveHullCheck (hull->firstclipnode, 0, 1, startd, endd);
+
+ // if we hit, unrotate endpos and normal, and store the entity we hit
+ if (trace.fraction != 1)