qbsp: side_t doesn't need sphere culling
This commit is contained in:
parent
b21e245d99
commit
1693bb3877
|
|
@ -37,9 +37,6 @@ struct side_t
|
|||
|
||||
int16_t lmshift;
|
||||
|
||||
qvec3d origin;
|
||||
vec_t radius;
|
||||
|
||||
bool onnode; // has this face been used as a BSP node plane yet?
|
||||
bool visible = true; // can any part of this side be seen from non-void parts of the level?
|
||||
// non-visible means we can discard the brush side
|
||||
|
|
|
|||
|
|
@ -36,6 +36,5 @@ face_t *CopyFace(const face_t *in);
|
|||
face_t *MirrorFace(const face_t *face);
|
||||
std::tuple<face_t *, face_t *> SplitFace(face_t *in, const qplane3d &split);
|
||||
void UpdateFaceSphere(face_t *in);
|
||||
void UpdateFaceSphere(side_t *in);
|
||||
bool BrushGE(const bspbrush_t &a, const bspbrush_t &b);
|
||||
std::vector<std::unique_ptr<bspbrush_t>> ChopBrushes(const std::vector<std::unique_ptr<bspbrush_t>> &input);
|
||||
|
|
|
|||
|
|
@ -459,7 +459,6 @@ static std::vector<side_t> CreateBrushFaces(const mapentity_t *src, hullbrush_t
|
|||
f.planenum = FindPositivePlane(plane, &f.planeside);
|
||||
|
||||
CheckFace(&f, mapface);
|
||||
UpdateFaceSphere(&f);
|
||||
}
|
||||
|
||||
// Rotatable objects must have a bounding box big enough to
|
||||
|
|
|
|||
|
|
@ -111,14 +111,7 @@ inline int FaceSide(const face_t *in, const qbsp_plane_t &split)
|
|||
|
||||
inline int FaceSide(const side_t *in, const qbsp_plane_t &split)
|
||||
{
|
||||
vec_t dist = split.distance_to(in->origin);
|
||||
|
||||
if (dist > in->radius)
|
||||
return SIDE_FRONT;
|
||||
else if (dist < -in->radius)
|
||||
return SIDE_BACK;
|
||||
else
|
||||
return FaceSide__(in->w, split);
|
||||
return FaceSide__(in->w, split);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
10
qbsp/csg4.cc
10
qbsp/csg4.cc
|
|
@ -80,16 +80,6 @@ void UpdateFaceSphere(face_t *in)
|
|||
in->radius = sqrt(in->radius);
|
||||
}
|
||||
|
||||
void UpdateFaceSphere(side_t *in)
|
||||
{
|
||||
in->origin = in->w.center();
|
||||
in->radius = 0;
|
||||
for (size_t i = 0; i < in->w.size(); i++) {
|
||||
in->radius = max(in->radius, qv::distance2(in->w[i], in->origin));
|
||||
}
|
||||
in->radius = sqrt(in->radius);
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
SplitFace
|
||||
|
|
|
|||
Loading…
Reference in New Issue