Skip to content

Commit

Permalink
--use join function
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner65 committed Feb 13, 2024
1 parent 7f56536 commit da34bc6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/esp/geo/OBB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ Mn::Range3D OBB::toAABB() const {
const Mn::Vector3 worldPoint =
center_ +
(rotation_.transformVectorNormalized(kCorners[i] * halfExtents_));
// TODO refactor to bbox.join when Magnum supports it
bbox.min() = Mn::Math::min(bbox.min(), worldPoint);
bbox.max() = Mn::Math::max(bbox.max(), worldPoint);
bbox = Mn::Math::join(bbox, worldPoint);
}
return bbox;
}
Expand Down Expand Up @@ -250,8 +248,7 @@ OBB computeGravityAlignedMOBB(const Mn::Vector3& gravity,
Mn::Range3D aabb;
for (const auto& pt : points) {
const auto transPt = T_w2b.transformVectorNormalized(pt);
aabb.min() = Mn::Math::min(aabb.min(), transPt);
aabb.max() = Mn::Math::max(aabb.max(), transPt);
aabb = Mn::Math::join(aabb, pt);
}
// Inverted normalized rotation
const auto inverseT_w2b = T_w2b.inverted().normalized();
Expand Down

0 comments on commit da34bc6

Please sign in to comment.