@@ -34,7 +34,7 @@ namespace cage
3434 CAGE_ASSERT (aspectRatio > 0 );
3535 CAGE_ASSERT (sign (near) == sign (far) && near != far);
3636 Real f = 1 / tan (fov / 2 );
37- return Mat4 (f / aspectRatio, 0 , 0 , 0 , 0 , f, 0 , 0 , 0 , 0 , ( far + near) / (near - far ), -1 , 0 , 0 , far * near * 2.0 / (near - far ), 0 );
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 );
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 (near * 2.0 / (right - left), 0 , 0 , 0 , 0 , near * 2.0 / (top - bottom ), 0 , 0 , (right + left) / (right - left), (top + bottom ) / (top - bottom ), ( far + near) / (near - far ), -1 , 0 , 0 , 2 * far * near / (near - far ), 0 );
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 );
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 transpose ( Mat4 (2 / (right - left), 0 , 0 , -(right + left) / (right - left ), 0 , 2 / (top - bottom ), 0 , -(top + bottom ) / (top - bottom ), 0 , 0 , - 2 / (far - near ), -(far + near) / (far - near), 0 , 0 , 0 , 1 ) );
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 );
6868 }
6969
7070 StringPointer stereoModeToString (StereoModeEnum mode)
0 commit comments