qbsp: add Face_Plane
This commit is contained in:
parent
bca6a55662
commit
7d1dc71069
|
|
@ -35,6 +35,8 @@ typedef struct brush_s {
|
|||
|
||||
class mapbrush_t;
|
||||
|
||||
plane_t Face_Plane(const face_t *face);
|
||||
|
||||
int Brush_ListCountWithCFlags(const brush_t *brush, int cflags);
|
||||
int Brush_ListCount(const brush_t *brush);
|
||||
int Brush_NumFaces(const brush_t *brush);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,28 @@ typedef struct hullbrush_s {
|
|||
int edges[MAX_HULL_EDGES][2];
|
||||
} hullbrush_t;
|
||||
|
||||
/*
|
||||
=================
|
||||
Face_Plane
|
||||
=================
|
||||
*/
|
||||
plane_t
|
||||
Face_Plane(const face_t *face)
|
||||
{
|
||||
const qbsp_plane_t *plane = &map.planes.at(face->planenum);
|
||||
plane_t result;
|
||||
|
||||
result.dist = plane->dist;
|
||||
VectorCopy(plane->normal, result.normal);
|
||||
|
||||
if (face->planeside) {
|
||||
VectorScale(result.normal, -1.0, result.normal);
|
||||
result.dist = -result.dist;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CheckFace
|
||||
|
|
|
|||
Loading…
Reference in New Issue