From b7ed89fcf0ff8dcf60e0b0840bd96429fdc68465 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Tue, 11 Oct 2016 18:27:31 +0300 Subject: [PATCH] mat3 scale --- include/cglm-mat3.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/cglm-mat3.h b/include/cglm-mat3.h index 102a417..b8ff319 100644 --- a/include/cglm-mat3.h +++ b/include/cglm-mat3.h @@ -136,4 +136,20 @@ glm_mat3_mulv(mat3 m, vec3 v, vec3 dest) { dest[2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2]; } +/*! + * @brief scale (multiply with scalar) matrix + * + * multiply matrix with scalar + * + * @param[in, out] m matrix + * @param[in] s scalar + */ +CGLM_INLINE +void +glm_mat3_scale(mat3 m, float s) { + m[0][0] *= s; m[0][1] *= s; m[0][2] *= s; + m[1][0] *= s; m[1][1] *= s; m[1][2] *= s; + m[2][0] *= s; m[2][1] *= s; m[2][2] *= s; +} + #endif /* cglm_mat3_h */