diff --git a/include/zeus/COBBox.hpp b/include/zeus/COBBox.hpp index 9beda9f..76392e5 100644 --- a/include/zeus/COBBox.hpp +++ b/include/zeus/COBBox.hpp @@ -35,7 +35,7 @@ public: COBBox(const CTransform& xf, const CVector3f& extents) : transform(xf), extents(extents) {} - CAABox calculateAABox(const CTransform& transform = CTransform()) const; + CAABox calculateAABox(const CTransform& worldXf = CTransform()) const; static COBBox FromAABox(const CAABox& box, const CTransform& xf) { diff --git a/src/COBBox.cpp b/src/COBBox.cpp index 7e90dbe..958791d 100644 --- a/src/COBBox.cpp +++ b/src/COBBox.cpp @@ -3,15 +3,14 @@ namespace zeus { -CAABox COBBox::calculateAABox(const CTransform& transform) const +CAABox COBBox::calculateAABox(const CTransform& worldXf) const { CAABox ret = CAABox::skInvertedBox; - CTransform trans = transform * transform; + CTransform trans = worldXf * transform; static const CVector3f basis[8] = {{1.f, 1.f, 1.f}, {1.f, 1.f, -1.f}, {1.f, -1.f, 1.f}, {1.f, -1.f, -1.f}, {-1.f, -1.f, -1.f}, {-1.f, -1.f, 1.f}, {-1.f, 1.f, -1.f}, {-1.f, 1.f, 1.f}}; CVector3f p = extents * basis[0]; - ret.accumulateBounds(trans * p); p = extents * basis[1]; ret.accumulateBounds(trans * p);