From eeaf6cb3c1ca5e8d384e958ca80896cb520157d8 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Thu, 29 Nov 2012 15:59:45 +1000 Subject: [PATCH] Change fovy parameter to accept a generic angle --- src/funs/projection.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/funs/projection.rs b/src/funs/projection.rs index c9609ec..3b1e2c0 100644 --- a/src/funs/projection.rs +++ b/src/funs/projection.rs @@ -1,5 +1,5 @@ use funs::triganomic::tan; -use angle::Radians; +use angle::Angle; use mat::Mat4; use num::cast::cast; use num::consts::pi; @@ -12,8 +12,8 @@ use num::ext::FloatExt; * can be found [here](http://www.opengl.org/wiki/GluPerspective_code). */ #[inline(always)] -pure fn perspective(fovy: Radians, aspectRatio: T, near: T, far: T) -> Mat4 { - let ymax = near * tan(&fovy); +pure fn perspective>(fovy: A, aspectRatio: T, near: T, far: T) -> Mat4 { + let ymax = near * tan(&fovy.to_radians()); let xmax = ymax * aspectRatio; frustum(-xmax, xmax, -ymax, ymax, near, far)