aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/math/mat4.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/math/mat4.h b/include/math/mat4.h
index f3601b6..bbe1a20 100644
--- a/include/math/mat4.h
+++ b/include/math/mat4.h
@@ -311,9 +311,13 @@ static inline mat4 mat4_ortho(R left, R right, R bottom, R top, R near, R far) {
311 const R tx = -(right + left) / (right - left); 311 const R tx = -(right + left) / (right - left);
312 const R ty = -(top + bottom) / (top - bottom); 312 const R ty = -(top + bottom) / (top - bottom);
313 const R tz = -(far + near) / (far - near); 313 const R tz = -(far + near) / (far - near);
314 // clang-format off
314 return mat4_make( 315 return mat4_make(
315 2 / (right - left), 0, 0, tx, 0, 2 / (top - bottom), 0, ty, 0, 0, 316 2 / (right - left), 0, 0, tx,
316 -2 / (far - near), tz, 0, 0, 0, 1); 317 0, 2 / (top - bottom), 0, ty,
318 0, 0, -2 / (far - near), tz,
319 0, 0, 0, 1);
320 // clang-format on
317} 321}
318 322
319/// Create a perspective projection matrix. 323/// Create a perspective projection matrix.