add ortho

This commit is contained in:
Matthew 2025-08-24 13:54:16 +10:00
parent 98701be20c
commit f8d1707450

16
math.d
View File

@ -806,6 +806,22 @@ Perspective(f32 fov, f32 aspect, f32 near, f32 far)
return res; return res;
} }
void
Ortho(Mat4* mat, f32 left, f32 bottom, f32 right, f32 top, f32 near, f32 far)
{
MatZero(mat);
glm_ortho(left, right, bottom, top, near, far, mat.glm_mat.ptr);
}
Mat4
Ortho(f32 left, f32 bottom, f32 right, f32 top, f32 near, f32 far)
{
Mat4 mat;
MatZero(&mat);
glm_ortho(left, right, bottom, top, near, far, mat.glm_mat.ptr);
return mat;
}
pragma(inline): Vec3 pragma(inline): Vec3
Rotate(Quat q, Vec3 vec) Rotate(Quat q, Vec3 vec)
{ {