mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-22 02:44:38 +00:00
(math/matrix_4x4c.) Cleanup
This commit is contained in:
parent
2c09bbcda3
commit
4078bc5756
@ -155,11 +155,13 @@ void matrix_4x4_translate(math_matrix_4x4 *out, float x,
|
||||
void matrix_4x4_projection(math_matrix_4x4 *out, float znear,
|
||||
float zfar)
|
||||
{
|
||||
float delta_z = zfar - znear;
|
||||
|
||||
memset(out, 0, sizeof(*out));
|
||||
MAT_ELEM_4X4(*out, 0, 0) = znear;
|
||||
MAT_ELEM_4X4(*out, 1, 1) = zfar;
|
||||
MAT_ELEM_4X4(*out, 2, 2) = (zfar + znear) / (zfar - znear);
|
||||
MAT_ELEM_4X4(*out, 2, 3) = -2.0f * zfar * znear / (zfar - znear);
|
||||
MAT_ELEM_4X4(*out, 2, 2) = (zfar + znear) / delta_z;
|
||||
MAT_ELEM_4X4(*out, 2, 3) = -2.0f * zfar * znear / delta_z;
|
||||
MAT_ELEM_4X4(*out, 3, 2) = -1.0f;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user