From 54632ecce5fd2e1b0aa6ec08a538755ed6264dd2 Mon Sep 17 00:00:00 2001 From: "LAPTOP-GHFRJ92J\\John" Date: Tue, 29 Aug 2023 02:13:24 -0500 Subject: [PATCH] mat4_ins3 should copy mat3s to upper left mat4s. Previously, it just made a new mat4s r and put the mat3 into that and returned it. Now it takes in a mat4s and copies the mat3s to that. --- include/cglm/struct/mat4.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/cglm/struct/mat4.h b/include/cglm/struct/mat4.h index 346751b..0e7760b 100644 --- a/include/cglm/struct/mat4.h +++ b/include/cglm/struct/mat4.h @@ -25,7 +25,7 @@ CGLM_INLINE mat4s glms_mat4_zero(void); CGLM_INLINE mat3s glms_mat4_pick3(mat4s mat); CGLM_INLINE mat3s glms_mat4_pick3t(mat4s mat); - CGLM_INLINE mat4s glms_mat4_ins3(mat3s mat); + CGLM_INLINE mat4s glms_mat4_ins3(mat3s mat, mat4s dest); CGLM_INLINE mat4s glms_mat4_mul(mat4s m1, mat4s m2); CGLM_INLINE mat4s glms_mat4_mulN(mat4s * __restrict matrices[], uint32_t len); CGLM_INLINE vec4s glms_mat4_mulv(mat4s m, vec4s v); @@ -183,14 +183,14 @@ glms_mat4_(pick3t)(mat4s mat) { * @brief copy mat3 to mat4's upper-left * * @param[in] mat source + * @param[in] dest destination * @returns destination */ CGLM_INLINE mat4s -glms_mat4_(ins3)(mat3s mat) { - mat4s r; - glm_mat4_ins3(mat.raw, r.raw); - return r; +glms_mat4_(ins3)(mat3s mat, mat4s dest) { + glm_mat4_ins3(mat.raw, dest.raw); + return dest; } /*!