| 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) |
| 1818 | { |
| 1819 | ASSERT_COVERED(HMM_Perspective_RH_ZO); |
| 1820 | |
| 1821 | HMM_Mat4 Result = {0}; |
| 1822 | |
| 1823 | // See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml |
| 1824 | |
| 1825 | float Cotangent = 1.0f / HMM_TanF(FOV / 2.0f); |
| 1826 | Result.Elements[0][0] = Cotangent / AspectRatio; |
| 1827 | Result.Elements[1][1] = Cotangent; |
| 1828 | Result.Elements[2][3] = -1.0f; |
| 1829 | |
| 1830 | Result.Elements[2][2] = (Far) / (Near - Far); |
| 1831 | Result.Elements[3][2] = (Near * Far) / (Near - Far); |
| 1832 | |
| 1833 | return Result; |
| 1834 | } |
| 1835 | |
| 1836 | COVERAGE(HMM_Perspective_LH_NO, 1) |
| 1837 | static inline HMM_Mat4 HMM_Perspective_LH_NO(float FOV, float AspectRatio, float Near, float Far) |
no test coverage detected