Zero out matrix in perspective function

This commit is contained in:
AllMeatball 2025-05-25 17:05:38 -05:00
parent c97753e805
commit 2245cac4ed

View File

@ -63,6 +63,14 @@ void D3DRMMatrixInvert(D3DRMMATRIX4D out, const D3DRMMATRIX4D m)
void HMM_Perspective_LH_NO(D3DRMMATRIX4D Result, float FOV, float AspectRatio, float Near, float Far)
{
for (int i = 0; i < 4; i++) {
std::fill(
Result[i],
Result[i]+4,
0.f
);
}
// See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml
float Cotangent = 1.0f / SDL_tanf(FOV / 2.0f);