p_sight.c
//
// Returns the fractional intercept point
// along the first divline.
// This is only called by the addthings and addlines traversers.
//
Returns the fractional intercept point
along the first divline.
This is only called by the addthings and addlines traversers.
Returns the fractional intercept point along the first divline . This is only called by the addthings and addlines traversers .
fixed_t P_InterceptVector2(divline_t *v2, divline_t *v1)
{
   fixed_t frac;
   fixed_t num;
   fixed_t den, temp;
   FixedMul2(den, v1->dy>>8,v2->dx);
   FixedMul2(temp, v1->dx >> 8, v2->dy);
   den = den - temp;
   if(den == 0)
      return 0;
   FixedMul2(temp, (v2->y - v1->y) >> 8, v1->dx);
   FixedMul2(num, (v1->x - v2->x) >> 8, v1->dy);
   num  = num + temp;
   frac = FixedDiv(num, den);
   return frac;
}
fixed_t P_InterceptVector2 ( divline_t * v2 , divline_t * v1 ) { fixed_t frac ; fixed_t num ; fixed_t den , temp ; FixedMul2 ( den , v1 -> dy >> 8 , v2 -> dx ) ; FixedMul2 ( temp , v1 -> dx >> 8 , v2 -> dy ) ; den = den - temp ; if ( den == 0 ) return 0 ; FixedMul2 ( temp , ( v2 -> y - v1 -> y ) >> 8 , v1 -> dx ) ; FixedMul2 ( num , ( v1 -> x - v2 -> x ) >> 8 , v1 -> dy ) ; num = num + temp ; frac = FixedDiv ( num , den ) ; return frac ; }
Returns the fractional intercept point
along the first divline.
Returns the fractional intercept point along the first divline .