From 32220526529e9f429c2bc8e8032889e3848c4193 Mon Sep 17 00:00:00 2001 From: Garux Date: Wed, 21 Mar 2018 04:12:06 +0300 Subject: [PATCH] fix and improve Transform manipulator bbox faces pickup --- radiant/selection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radiant/selection.cpp b/radiant/selection.cpp index 6bcbd83f..f77469d4 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -2350,7 +2350,7 @@ public: Selectable* selectable = 0; Selectable* selectable2 = 0; double bestDot = 1; - const Vector3 viewer = vector3_normalised( view.getViewer() ); + const Vector3 viewdir( vector3_normalised( Vector3( view.GetModelview()[2], view.GetModelview()[6], view.GetModelview()[10] ) ) ); for ( int i = 0; i < 3; ++i ){ for ( int j = 0; j < 2; ++j ){ const Vector3 normal = j? g_vector3_axes[i] : -g_vector3_axes[i]; @@ -2360,7 +2360,7 @@ public: && vector3_dot( normal, corners[indices[index + 2]] ) > 0 && vector3_dot( normal, corners[indices[index + 3]] ) > 0 ) { - const double dot = fabs( vector3_dot( normal, viewer ) ); + const double dot = fabs( vector3_dot( normal, viewdir ) ); const double diff = bestDot - dot; if( diff > 0.03 ){ bestDot = dot;