void FPortal::UpdateClipAngles()
{
	for(unsigned int i=0; i<Shape.Size(); i++)
	{
		ClipAngles[i] = R_PointToPseudoAngle(viewx, viewy, Shape[i]->x, Shape[i]->y);
	}
}
Esempio n. 2
0
bool Clipper::CheckBox(const fixed_t *bspcoord)
{
    angle_t angle1, angle2;

    int        boxpos;
    const int* check;

    // Find the corners of the box
    // that define the edges from current viewpoint.
    boxpos = (viewx <= bspcoord[BOXLEFT] ? 0 : viewx < bspcoord[BOXRIGHT ] ? 1 : 2) +
             (viewy >= bspcoord[BOXTOP ] ? 0 : viewy > bspcoord[BOXBOTTOM] ? 4 : 8);

    if (boxpos == 5) return true;

    check = checkcoord[boxpos];
    angle1 = R_PointToPseudoAngle (viewx, viewy, bspcoord[check[0]], bspcoord[check[1]]);
    angle2 = R_PointToPseudoAngle (viewx, viewy, bspcoord[check[2]], bspcoord[check[3]]);

    return SafeCheckRange(angle2, angle1);
}