]> git.tdb.fi Git - libs/gl.git/blobdiff - source/matrix.cpp
Field of view is an angle too
[libs/gl.git] / source / matrix.cpp
index 092d2c62ca149cb73764d8c40ab00d7382a8f874..cac4a4fcd99afe6d2e110c80030aad39dd9352c1 100644 (file)
@@ -140,9 +140,9 @@ Matrix Matrix::frustum_centered(double w, double h, double n, double f)
        return frustum(-w/2, w/2, -h/2, h/2, n, f);
 }
 
-Matrix Matrix::perspective(double h, double a, double n, double f)
+Matrix Matrix::perspective(const Angle &h, double a, double n, double f)
 {
-       double hh = tan(h/2)*n;
+       double hh = tan(h/2.0)*n;
        return frustum(-hh*a, hh*a, -hh, hh, n, f);
 }