components/prboom/p_map.c
//                                                                  // phares
// PIT_CrossLine                                                    //   |
// Checks to see if a PE->LS trajectory line crosses a blocking     //   V
// line. Returns false if it does.
//
// tmbbox holds the bounding box of the trajectory. If that box
// does not touch the bounding box of the line in question,
// then the trajectory is not blocked. If the PE is on one side
// of the line and the LS is on the other side, then the
// trajectory is blocked.
//
// Currently this assumes an infinite line, which is not quite
// correct. A more correct solution would be to check for an
// intersection of the trajectory and the line, but that takes
// longer and probably really isn't worth the effort.
//
phares
PIT_CrossLine                                                    //   |
Checks to see if a PE->LS trajectory line crosses a blocking     //   V
line. Returns false if it does.

tmbbox holds the bounding box of the trajectory. If that box
does not touch the bounding box of the line in question,
then the trajectory is not blocked. If the PE is on one side
of the line and the LS is on the other side, then the
trajectory is blocked.

Currently this assumes an infinite line, which is not quite
correct. A more correct solution would be to check for an
intersection of the trajectory and the line, but that takes
longer and probably really isn't worth the effort.
phares PIT_CrossLine // | Checks to see if a PE - > LS trajectory line crosses a blocking // V line . Returns false if it does . tmbbox holds the bounding box of the trajectory . If that box does not touch the bounding box of the line in question then the trajectory is not blocked . If the PE is on one side of the line and the LS is on the other side then the trajectory is blocked . Currently this assumes an infinite line which is not quite correct . A more correct solution would be to check for an intersection of the trajectory and the line but that takes longer and probably really isn ' t worth the effort .
static 
boolean PIT_CrossLine (line_t* ld)
  {
  if (!(ld->flags & ML_TWOSIDED) ||
      (ld->flags & (ML_BLOCKING|ML_BLOCKMONSTERS)))
    if (!(tmbbox[BOXLEFT]   > ld->bbox[BOXRIGHT]  ||
          tmbbox[BOXRIGHT]  < ld->bbox[BOXLEFT]   ||
          tmbbox[BOXTOP]    < ld->bbox[BOXBOTTOM] ||
          tmbbox[BOXBOTTOM] > ld->bbox[BOXTOP]))
      if (P_PointOnLineSide(pe_x,pe_y,ld) != P_PointOnLineSide(ls_x,ls_y,ld))
        return(false);  
  return(true); 
  }
static boolean PIT_CrossLine ( line_t * ld ) { if ( ! ( ld -> flags & ML_TWOSIDED ) || ( ld -> flags & ( ML_BLOCKING | ML_BLOCKMONSTERS ) ) ) if ( ! ( tmbbox [ BOXLEFT ] > ld -> bbox [ BOXRIGHT ] || tmbbox [ BOXRIGHT ] < ld -> bbox [ BOXLEFT ] || tmbbox [ BOXTOP ] < ld -> bbox [ BOXBOTTOM ] || tmbbox [ BOXBOTTOM ] > ld -> bbox [ BOXTOP ] ) ) if ( P_PointOnLineSide ( pe_x , pe_y , ld ) != P_PointOnLineSide ( ls_x , ls_y , ld ) ) return ( false ) ; return ( true ) ; }
phares
PIT_CrossLine                                                    //   |
Checks to see if a PE->LS trajectory line crosses a blocking     //   V
line.
phares PIT_CrossLine // | Checks to see if a PE - > LS trajectory line crosses a blocking // V line .
// killough 3/26/98: make static // line blocks trajectory                   //   ^ // line doesn't block trajectory                    //   |