qbsp: rest of fix for qbsp_q2_bmodel_collision, only needed on type-cleanup branch
This commit is contained in:
parent
0326374d68
commit
4941a86cbe
|
|
@ -53,3 +53,4 @@ void FreeBrushes(mapentity_t *ent);
|
|||
|
||||
int FindPlane(const qplane3d &plane, int *side);
|
||||
int FindPositivePlane(int planenum);
|
||||
int FindPositivePlane(const qplane3d &plane, int *side);
|
||||
|
|
|
|||
|
|
@ -253,6 +253,22 @@ int FindPositivePlane(int planenum)
|
|||
return FindPlane(-plane, nullptr);
|
||||
}
|
||||
|
||||
int FindPositivePlane(const qplane3d &plane, int *side)
|
||||
{
|
||||
int planenum = FindPlane(plane, side);
|
||||
int positive_plane = FindPositivePlane(planenum);
|
||||
|
||||
if (planenum == positive_plane) {
|
||||
return planenum;
|
||||
}
|
||||
|
||||
// planenum itself isn't positive, so flip the planeside and return the positive version
|
||||
if (side) {
|
||||
*side = !*side;
|
||||
}
|
||||
return positive_plane;
|
||||
}
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
|
|
@ -394,7 +410,7 @@ static std::vector<face_t> CreateBrushFaces(const mapentity_t *src, hullbrush_t
|
|||
plane.dist = qv::dot(plane.normal, point);
|
||||
|
||||
f.texinfo = hullnum > 0 ? 0 : mapface.texinfo;
|
||||
f.planenum = FindPlane(plane, &f.planeside);
|
||||
f.planenum = FindPositivePlane(plane, &f.planeside);
|
||||
f.src_entity = const_cast<mapentity_t *>(src); // FIXME: get rid of consts on src in the callers?
|
||||
|
||||
CheckFace(&f, mapface);
|
||||
|
|
|
|||
Loading…
Reference in New Issue