qbsp: add sphere bounds for bspbrush_t
This commit is contained in:
parent
f4854ddb20
commit
20ca6d2ef9
|
|
@ -68,6 +68,9 @@ struct bspbrush_t {
|
|||
std::optional<uint32_t> outputnumber; /* only set for original brushes */
|
||||
mapentity_t *func_areaportal;
|
||||
|
||||
qvec3d sphere_origin;
|
||||
double sphere_radius;
|
||||
|
||||
void update_bounds();
|
||||
|
||||
std::unique_ptr<bspbrush_t> copy_unique() const;
|
||||
|
|
|
|||
|
|
@ -1096,4 +1096,7 @@ void bspbrush_t::update_bounds()
|
|||
for (const auto &face : sides) {
|
||||
this->bounds = this->bounds.unionWith(face.w.bounds());
|
||||
}
|
||||
|
||||
this->sphere_origin = (bounds.mins() + bounds.maxs()) / 2.0;
|
||||
this->sphere_radius = qv::length((bounds.maxs() - bounds.mins()) / 2.0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue