COBBox::FromAABox fix

This commit is contained in:
Jack Andersen 2019-03-07 18:15:58 -10:00
parent 855869b5b1
commit a240b39a11
1 changed files with 3 additions and 2 deletions

View File

@ -35,8 +35,9 @@ public:
CAABox calculateAABox(const CTransform& worldXf = CTransform()) const;
static COBBox FromAABox(const CAABox& box, const CTransform& xf) {
const CVector3f extents = box.max - box.center();
const CTransform newXf = CTransform::Translate(box.center()) * xf;
CVector3f center = box.center();
const CVector3f extents = box.max - center;
const CTransform newXf = xf * CTransform::Translate(center);
return COBBox(newXf, extents);
}