]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix orthographic projection matrix calculation
authorMikko Rasa <tdb@tdb.fi>
Sun, 16 Nov 2014 18:06:14 +0000 (20:06 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 16 Nov 2014 18:07:30 +0000 (20:07 +0200)
I made some last minute changes for c90cc1f and this got missed.

source/camera.cpp

index 6cbcf6f492680f537559206d311049f26af5f1db..d119e1eff1b67245b9fca74c4058b5d5077af8e3 100644 (file)
@@ -105,7 +105,7 @@ void Camera::apply() const
 
 void Camera::update_projection_matrix()
 {
-       float frustum_h = tan(fov/2.0f)*clip_near;
+       float frustum_h = (fov!=Geometry::Angle<float>::zero() ? tan(fov/2.0f)*clip_near : height/2);
        float frustum_w = frustum_h*aspect;
        float left = frustum_w*(frustum_x-1.0f);
        float right = frustum_w*(frustum_x+1.0f);