Browse Source

Fixed pick function... again

Christophe Riccio 14 years ago
parent
commit
b918e3ea3f
2 changed files with 3 additions and 1 deletions
  1. 1 1
      glm/gtc/matrix_transform.inl
  2. 2 0
      test/gtc/gtc_matrix_transform.cpp

+ 1 - 1
glm/gtc/matrix_transform.inl

@@ -359,7 +359,7 @@ namespace matrix_transform
 
 		// Translate and scale the picked region to the entire window
 		Result = translate(Result, Temp);
-		return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1));
+		return scale(Result, detail::tvec3<T>(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)));
 	}
 
     template <typename T> 

+ 2 - 0
test/gtc/gtc_matrix_transform.cpp

@@ -14,6 +14,8 @@
 int main()
 {
 	int Failed = 0;
+	
+	glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240));
 
 	return Failed;
 }