bbox fixes

This commit is contained in:
h4570
2022-07-23 18:34:35 +02:00
parent 1ae7939cc3
commit 23e98afe91
5 changed files with 36 additions and 2 deletions
+14
View File
@@ -25,8 +25,22 @@ BBox::BBox(Vec4* t_vertices, u32* faces, u32 count)
setData();
}
BBox::BBox(const BBox& t_bbox) : CoreBBox(t_bbox) { setData(); }
BBox::BBox(const BBox& t_bbox, const M4x4& t_matrix) {
for (u32 i = 0; i < 8; i++) {
_vertices[i] = t_matrix * _vertices[i];
}
setData();
}
BBox::BBox(Vec4* t_vertices) : CoreBBox(t_vertices) { setData(); }
BBox BBox::getTransformed(const M4x4& t_matrix) {
return BBox(*this, t_matrix);
}
void BBox::setData() {
// This might be shortened with Vec4 operator overloading, but current
// implementation is more human readable.