qbsp: restore use of options.worldExtent
should fix minor precision differences in .prt files
This commit is contained in:
parent
1b1679fa22
commit
5cf82ee023
|
|
@ -147,7 +147,7 @@ std::vector<decomp_plane_t> RemoveRedundantPlanes(const std::vector<decomp_plane
|
|||
// outward-facing plane
|
||||
vec3_t normal;
|
||||
VectorCopy(plane.normal, normal);
|
||||
std::optional<winding_t> winding = winding_t::from_plane(normal, plane.distance);
|
||||
std::optional<winding_t> winding = winding_t::from_plane(normal, plane.distance, 10e6);
|
||||
|
||||
// clip `winding` by all of the other planes, flipped
|
||||
for (const decomp_plane_t &plane2 : planes) {
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ public:
|
|||
return p;
|
||||
}
|
||||
|
||||
static winding_base_t from_plane(const qvec3d &normal, const vec_t &dist)
|
||||
static winding_base_t from_plane(const qvec3d &normal, const vec_t &dist, const vec_t &worldextent)
|
||||
{
|
||||
/* find the major axis */
|
||||
vec_t max = -VECT_MAX;
|
||||
|
|
@ -452,8 +452,8 @@ public:
|
|||
qvec3d org = normal * dist;
|
||||
qvec3d vright = qv::cross(vup, normal);
|
||||
|
||||
vup *= 10e6;
|
||||
vright *= 10e6;
|
||||
vup *= worldextent;
|
||||
vright *= worldextent;
|
||||
|
||||
/* project a really big axis aligned box onto the plane */
|
||||
winding_base_t w(4);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,4 @@ struct qbsp_plane_t : plane_t
|
|||
|
||||
using winding_t = polylib::winding_base_t<MAXEDGES>;
|
||||
|
||||
inline winding_t BaseWindingForPlane(const qbsp_plane_t *p)
|
||||
{
|
||||
return winding_t::from_plane(p->normal, p->dist);
|
||||
}
|
||||
winding_t BaseWindingForPlane(const qbsp_plane_t *p);
|
||||
|
|
@ -452,7 +452,7 @@ static void Leaf_MakeFaces(
|
|||
VectorScale(plane.normal, -1, faceplane.normal);
|
||||
faceplane.dist = -plane.dist;
|
||||
|
||||
std::optional<winding_t> winding = winding_t::from_plane(faceplane.normal, faceplane.dist);
|
||||
std::optional<winding_t> winding = winding_t::from_plane(faceplane.normal, faceplane.dist, 10e6);
|
||||
|
||||
// clip `winding` by all of the other planes
|
||||
for (const plane_t &plane2 : planes) {
|
||||
|
|
|
|||
|
|
@ -492,6 +492,11 @@ static void EmitAreaPortals(node_t *headnode)
|
|||
LogPrint(LOG_STAT, "{:5} numareaportals\n", map.bsp.dareaportals.size());
|
||||
}
|
||||
|
||||
winding_t BaseWindingForPlane(const qbsp_plane_t *p)
|
||||
{
|
||||
return winding_t::from_plane(p->normal, p->dist, options.worldExtent);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
ProcessEntity
|
||||
|
|
|
|||
Loading…
Reference in New Issue