From 889a7594d9f156339f68c965d4a7915eda6260fe Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 2 Jan 2013 00:05:07 +0000 Subject: [PATCH] Fixed bug #34, GLM_FORCE_RADIANS not working on glm::perspective --- glm/gtc/matrix_transform.inl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 2245a4f9..790ecf55 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -236,7 +236,13 @@ namespace glm 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 right = range * aspect; valType bottom = -range;