@@ -183,14 +183,10 @@ struct CalcBoundsOperation {
183
183
glm::max (glm::length (halfAxes[0 ]), glm::length (halfAxes[1 ]));
184
184
sphereRadius = glm::max (sphereRadius, glm::length (halfAxes[2 ]));
185
185
186
- FVector xs (halfAxes[0 ].x , halfAxes[1 ].x , halfAxes[2 ].x );
187
- FVector ys (halfAxes[0 ].y , halfAxes[1 ].y , halfAxes[2 ].y );
188
- FVector zs (halfAxes[0 ].z , halfAxes[1 ].z , halfAxes[2 ].z );
189
-
190
186
FBoxSphereBounds result;
191
187
result.Origin = VecMath::createVector (center);
192
188
result.SphereRadius = sphereRadius;
193
- result.BoxExtent = FVector (xs. GetAbsMax (), ys. GetAbsMax (), zs. GetAbsMax () );
189
+ result.BoxExtent = FVector (sphereRadius, sphereRadius, sphereRadius );
194
190
return result;
195
191
}
196
192
@@ -207,14 +203,17 @@ struct CalcBoundsOperation {
207
203
double sphereRadius = glm::max (glm::length (corner1), glm::length (corner2));
208
204
sphereRadius = glm::max (sphereRadius, glm::length (corner3));
209
205
210
- FVector xs (halfAxes[0 ].x , halfAxes[1 ].x , halfAxes[2 ].x );
211
- FVector ys (halfAxes[0 ].y , halfAxes[1 ].y , halfAxes[2 ].y );
212
- FVector zs (halfAxes[0 ].z , halfAxes[1 ].z , halfAxes[2 ].z );
206
+ double maxX = glm::abs (halfAxes[0 ].x ) + glm::abs (halfAxes[1 ].x ) +
207
+ glm::abs (halfAxes[2 ].x );
208
+ double maxY = glm::abs (halfAxes[0 ].y ) + glm::abs (halfAxes[1 ].y ) +
209
+ glm::abs (halfAxes[2 ].y );
210
+ double maxZ = glm::abs (halfAxes[0 ].z ) + glm::abs (halfAxes[1 ].z ) +
211
+ glm::abs (halfAxes[2 ].z );
213
212
214
213
FBoxSphereBounds result;
215
214
result.Origin = VecMath::createVector (center);
216
215
result.SphereRadius = sphereRadius;
217
- result.BoxExtent = FVector (xs. GetAbsMax (), ys. GetAbsMax (), zs. GetAbsMax () );
216
+ result.BoxExtent = FVector (maxX, maxY, maxZ );
218
217
return result;
219
218
}
220
219
0 commit comments