diff --git a/src/Magnum/Math/Intersection.h b/src/Magnum/Math/Intersection.h index 8dc52580e..7c527dad5 100644 --- a/src/Magnum/Math/Intersection.h +++ b/src/Magnum/Math/Intersection.h @@ -643,18 +643,19 @@ template bool aabbCone( { const Vector3 c = aabbCenter - coneOrigin; - for(const Int axis: {0, 1, 2}) { + /* Not doing for(Int axis: {0, 1, 2}) because that'd need an + include. FFS, C++. */ + for(Int axis = 0; axis != 3; ++axis) { const Int z = axis; const Int x = (axis + 1) % 3; const Int y = (axis + 2) % 3; if(coneNormal[z] != T(0)) { - const Float t0 = ((c[z] - aabbExtents[z])/coneNormal[z]); - const Float t1 = ((c[z] + aabbExtents[z])/coneNormal[z]); - - const Vector3 i0 = coneNormal*t0; - const Vector3 i1 = coneNormal*t1; - - for(const auto& i : {i0, i1}) { + /* Dtto here, making an array to not need an initializer_list */ + const Vector3 i01[]{ + coneNormal*((c[z] - aabbExtents[z])/coneNormal[z]), + coneNormal*((c[z] + aabbExtents[z])/coneNormal[z]) + }; + for(const Vector3& i: i01) { Vector3 closestPoint = i; if(i[x] - c[x] > aabbExtents[x]) {