@@ -33,8 +33,8 @@ namespace cage
3333 CAGE_ASSERT (fov > Rads (0 ));
3434 CAGE_ASSERT (aspectRatio > 0 );
3535 CAGE_ASSERT (sign (near) == sign (far) && near != far);
36- Real f = 1 / tan (fov / 2 );
37- return Mat4 (f / aspectRatio, 0 , 0 , 0 , 0 , f, 0 , 0 , 0 , 0 , - far / (far - near ), -1 , 0 , 0 , (- far * near) / (far - near ), 0 );
36+ const Real f = 1 / tan (fov / 2 );
37+ return Mat4 (f / aspectRatio, 0 , 0 , 0 , 0 , f, 0 , 0 , 0 , 0 , far / (near - far ), -1 , 0 , 0 , (far * near) / (near - far ), 0 );
3838 }
3939
4040 Mat4 perspectiveProjection (Rads fov, Real aspectRatio, Real near, Real far, Real zeroParallaxDistance, Real eyeSeparation)
@@ -56,15 +56,15 @@ namespace cage
5656 CAGE_ASSERT (left != right);
5757 CAGE_ASSERT (bottom != top);
5858 CAGE_ASSERT (sign (near) == sign (far) && near != far);
59- return Mat4 ((2 * near) / (right - left), 0 , 0 , 0 , 0 , - (2 * near) / (bottom - top ), 0 , 0 , (right + left) / (right - left), -(bottom + top ) / (bottom - top ), - far / (far - near ), -1 , 0 , 0 , - (far * near) / (far - near ), 0 );
59+ return Mat4 ((2 * near) / (right - left), 0 , 0 , 0 , 0 , (2 * near) / (top - bottom ), 0 , 0 , (right + left) / (right - left), (top + bottom ) / (top - bottom ), far / (near - far ), -1 , 0 , 0 , (far * near) / (near - far ), 0 );
6060 }
6161
6262 Mat4 orthographicProjection (Real left, Real right, Real bottom, Real top, Real near, Real far)
6363 {
6464 CAGE_ASSERT (left != right);
6565 CAGE_ASSERT (bottom != top);
6666 CAGE_ASSERT (near != far);
67- return Mat4 (2 / (right - left), 0 , 0 , 0 , 0 , 2 / (top - bottom), 0 , 0 , 0 , 0 , - 1 / (far - near ), 0 , -(right + left) / (right - left), -(top + bottom) / (top - bottom), - near / (far - near ), 1 );
67+ return Mat4 (2 / (right - left), 0 , 0 , 0 , 0 , 2 / (top - bottom), 0 , 0 , 0 , 0 , 1 / (near - far ), 0 , -(right + left) / (right - left), -(top + bottom) / (top - bottom), near / (near - far ), 1 );
6868 }
6969
7070 StringPointer stereoModeToString (StereoModeEnum mode)
0 commit comments