updated formulas

This commit is contained in:
2025-03-22 08:36:06 +03:00
parent 4f037a1952
commit 2b59fb6aa2
4 changed files with 36 additions and 6 deletions

View File

@@ -28,8 +28,9 @@ namespace omath::source_engine
Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3<float>& cam_origin)
{
return MatCameraView(ForwardVector(angles), RightVector(angles), UpVector(angles), cam_origin);
return MatCameraView(ForwardVector(angles), RightVector(angles), -UpVector(angles), cam_origin);
}
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
const float far)
{
@@ -43,7 +44,6 @@ namespace omath::source_engine
{0, 1.f / (fovHalfTan), 0, 0},
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
{0, 0, 1, 0},
};
}
} // namespace omath::source_engine