Skip to content

Commit 0574116

Browse files
authored
Refactor former unused variable in AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive (#1149)
1 parent 5f2a773 commit 0574116

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/w3d/renderer/aabtree.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,13 @@ int AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive(CullNodeStruct *
237237
int direction,
238238
unsigned char &flags)
239239
{
240-
static const float sign[2] = { -1.0f, 1.0f };
241-
float bounds[2], start[2];
242-
bounds[0] = -node->m_min[axis_r];
243-
bounds[1] = node->m_max[axis_r];
244-
start[0] = -start_point[axis_r];
245-
start[1] = start_point[axis_r];
240+
constexpr float sign[2] = { -1.0f, 1.0f };
241+
float bounds[2];
242+
float start[2];
243+
bounds[0] = node->m_min[axis_r] * sign[0];
244+
bounds[1] = node->m_max[axis_r] * sign[1];
245+
start[0] = start_point[axis_r] * sign[0];
246+
start[1] = start_point[axis_r] * sign[1];
246247

247248
if (start_point[axis_1] < node->m_min[axis_1] || start_point[axis_2] < node->m_min[axis_2]
248249
|| start_point[axis_1] > node->m_max[axis_1] || start_point[axis_2] > node->m_max[axis_2]

0 commit comments

Comments
 (0)