Browse Source

Fixed bug #34, GLM_FORCE_RADIANS not working on glm::perspective

Christophe Riccio 13 years ago
parent
commit
889a7594d9
1 changed files with 7 additions and 1 deletions
  1. 7 1
      glm/gtc/matrix_transform.inl

+ 7 - 1
glm/gtc/matrix_transform.inl

@@ -236,7 +236,13 @@ namespace glm
 		valType const & zFar
 		valType const & zFar
 	)
 	)
 	{
 	{
-		valType range = tan(radians(fovy / valType(2))) * zNear;	
+#ifdef GLM_FORCE_RADIANS
+		valType const rad = fov;
+#else
+		valType const rad = glm::radians(fov);
+#endif
+        
+		valType range = tan(radians(rad / valType(2))) * zNear;	
 		valType left = -range * aspect;
 		valType left = -range * aspect;
 		valType right = range * aspect;
 		valType right = range * aspect;
 		valType bottom = -range;
 		valType bottom = -range;