From bb17e8580bae52fe811e3b4e1cef9d8d77db02d1 Mon Sep 17 00:00:00 2001 From: Tyge Date: Mon, 20 Apr 2020 09:19:05 +0200 Subject: glm update --- glm/quat.h | 2 +- glm/vec3.h | 11 ++++++----- glm/vec4.h | 11 ++++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/glm/quat.h b/glm/quat.h index 98afb5d5..8a237237 100644 --- a/glm/quat.h +++ b/glm/quat.h @@ -60,7 +60,7 @@ real_part = 0; \ t = fabs(u.x) > fabs(u.z) ? (glm_vec3##tag) {-u.y, u.x, 0} : (glm_vec3##tag) {0, -u.z, u.y}; \ } else /* Build quaternion the standard way.*/ \ - t = _glm_vec3_CROSS(u, v); \ + t = (glm_vec3##tag) {_glm_vec3_CROSS(u, v)}; \ glm_quat##tag q = (glm_quat##tag) {t.x, t.y, t.z, real_part}; \ return glm_quat##tag##_normalize(q); \ } \ diff --git a/glm/vec3.h b/glm/vec3.h index d741d9ce..1d4b0312 100644 --- a/glm/vec3.h +++ b/glm/vec3.h @@ -155,25 +155,26 @@ return u; \ } \ /* Swizzle */ \ + static inline glm_vec3##tag \ glm_vec3##tag##_xzy(glm_vec3##tag u) { \ return (glm_vec3##tag) {u.x, u.z, u.y}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec3##tag##_yxz(glm_vec3##tag u) { \ return (glm_vec3##tag) {u.y, u.x, u.z}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec3##tag##_yzx(glm_vec3##tag u) { \ return (glm_vec3##tag) {u.y, u.z, u.x}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec3##tag##_zxy(glm_vec3##tag u) { \ return (glm_vec3##tag) {u.z, u.x, u.y}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec3##tag##_zyx(glm_vec3##tag u) { \ return (glm_vec3##tag) {u.z, u.y, u.x}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec3##tag##_swizzle(glm_vec3##tag u, const char* swz) { \ T* a = glm_vec3_arr(u); \ diff --git a/glm/vec4.h b/glm/vec4.h index ac7a1e4f..761b2237 100644 --- a/glm/vec4.h +++ b/glm/vec4.h @@ -113,25 +113,26 @@ glm_vec4##tag##_xyz(glm_vec4##tag u) { \ return (glm_vec3##tag) {u.x, u.y, u.z}; \ }; \ + static inline glm_vec3##tag \ glm_vec4##tag##_xzy(glm_vec4##tag u) { \ return (glm_vec3##tag) {u.x, u.z, u.y}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec4##tag##_yxz(glm_vec4##tag u) { \ return (glm_vec3##tag) {u.y, u.x, u.z}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec4##tag##_yzx(glm_vec4##tag u) { \ return (glm_vec3##tag) {u.y, u.z, u.x}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec4##tag##_zxy(glm_vec4##tag u) { \ return (glm_vec3##tag) {u.z, u.x, u.y}; \ - }; \ + } \ static inline glm_vec3##tag \ glm_vec4##tag##_zyx(glm_vec4##tag u) { \ return (glm_vec3##tag) {u.z, u.y, u.x}; \ - }; \ + } \ \ static inline glm_vec4##tag \ glm_vec4##tag##_swizzle(glm_vec4##tag u, const char* swz) { \ -- cgit v1.2.3