From 057411650749de2791d624a64e744cf23131b56f Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:30:29 +0200 Subject: [PATCH] Refactor former unused variable in AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive (#1149) --- src/w3d/renderer/aabtree.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/w3d/renderer/aabtree.cpp b/src/w3d/renderer/aabtree.cpp index 600b22740..0d0b5cb3b 100644 --- a/src/w3d/renderer/aabtree.cpp +++ b/src/w3d/renderer/aabtree.cpp @@ -237,12 +237,13 @@ int AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive(CullNodeStruct * int direction, unsigned char &flags) { - static const float sign[2] = { -1.0f, 1.0f }; - float bounds[2], start[2]; - bounds[0] = -node->m_min[axis_r]; - bounds[1] = node->m_max[axis_r]; - start[0] = -start_point[axis_r]; - start[1] = start_point[axis_r]; + constexpr float sign[2] = { -1.0f, 1.0f }; + float bounds[2]; + float start[2]; + bounds[0] = node->m_min[axis_r] * sign[0]; + bounds[1] = node->m_max[axis_r] * sign[1]; + start[0] = start_point[axis_r] * sign[0]; + start[1] = start_point[axis_r] * sign[1]; if (start_point[axis_1] < node->m_min[axis_1] || start_point[axis_2] < node->m_min[axis_2] || start_point[axis_1] > node->m_max[axis_1] || start_point[axis_2] > node->m_max[axis_2]