refactor: apply review changes

This commit is contained in:
Wellinator
2022-07-19 09:12:00 -03:00
parent e7e4f375ba
commit 81686a8033
2 changed files with 15 additions and 16 deletions
+11 -11
View File
@@ -50,7 +50,7 @@ void BBox::setData() {
_bottomFace = BBoxFace(_vertices[0], _vertices[5], _vertices[0].y);
}
const Vec4 BBox::min() {
Vec4 BBox::min() {
Vec4 temp, _min;
u8 isInitialized = 0;
@@ -70,7 +70,7 @@ const Vec4 BBox::min() {
return _min;
}
const Vec4 BBox::max() {
Vec4 BBox::max() {
Vec4 temp, _max;
u8 isInitialized = 0;
@@ -90,7 +90,7 @@ const Vec4 BBox::max() {
return _max;
}
void BBox::calcMinMax(Vec4& res_min, Vec4& res_max) {
void BBox::getMinMax(Vec4* res_min, Vec4* res_max) {
Vec4 temp = Vec4();
u8 isInitialized = 0;
@@ -99,18 +99,18 @@ void BBox::calcMinMax(Vec4& res_min, Vec4& res_max) {
temp.set(vertices[i].x, vertices[i].y, vertices[i].z, 1.0F);
if (isInitialized == 0) {
isInitialized = 1;
res_min.set(temp);
res_max.set(temp);
res_min->set(temp);
res_max->set(temp);
}
if (res_min.x > temp.x) res_min.x = temp.x;
if (temp.x > res_max.x) res_max.x = temp.x;
if (res_min->x > temp.x) res_min->x = temp.x;
if (temp.x > res_max->x) res_max->x = temp.x;
if (res_min.y > temp.y) res_min.y = temp.y;
if (temp.y > res_max.y) res_max.y = temp.y;
if (res_min->y > temp.y) res_min->y = temp.y;
if (temp.y > res_max->y) res_max->y = temp.y;
if (res_min.z > temp.z) res_min.z = temp.z;
if (temp.z > res_max.z) res_max.z = temp.z;
if (res_min->z > temp.z) res_min->z = temp.z;
if (temp.z > res_max->z) res_max->z = temp.z;
}
}