Fixed pick implementation... again

This commit is contained in:
Christophe Riccio 2011-03-09 09:51:19 +00:00
parent 9cf34a3794
commit 7ca74e2b4d

View File

@ -338,8 +338,13 @@ namespace matrix_transform
if(!(delta.x > T(0) && delta.y > T(0))) if(!(delta.x > T(0) && delta.y > T(0)))
return Result; // Error return Result; // Error
detail::tvec3<T> Temp(
(T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x,
(T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y,
T(0));
// Translate and scale the picked region to the entire window // Translate and scale the picked region to the entire window
Result = translate(Result, (T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x, (T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y, T(0)); Result = translate(Result, Temp);
return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)); return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1));
} }