| 1795 | |
| 1796 | COVERAGE(HMM_Perspective_RH_NO, 1) |
| 1797 | static inline HMM_Mat4 HMM_Perspective_RH_NO(float FOV, float AspectRatio, float Near, float Far) |
| 1798 | { |
| 1799 | ASSERT_COVERED(HMM_Perspective_RH_NO); |
| 1800 | |
| 1801 | HMM_Mat4 Result = {0}; |
| 1802 | |
| 1803 | // See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml |
| 1804 | |
| 1805 | float Cotangent = 1.0f / HMM_TanF(FOV / 2.0f); |
| 1806 | Result.Elements[0][0] = Cotangent / AspectRatio; |
| 1807 | Result.Elements[1][1] = Cotangent; |
| 1808 | Result.Elements[2][3] = -1.0f; |
| 1809 | |
| 1810 | Result.Elements[2][2] = (Near + Far) / (Near - Far); |
| 1811 | Result.Elements[3][2] = (2.0f * Near * Far) / (Near - Far); |
| 1812 | |
| 1813 | return Result; |
| 1814 | } |
| 1815 | |
| 1816 | COVERAGE(HMM_Perspective_RH_ZO, 1) |
| 1817 | static inline HMM_Mat4 HMM_Perspective_RH_ZO(float FOV, float AspectRatio, float Near, float Far) |
no test coverage detected