From 32e34ffe25b2bfe569911d864be3ecc6d2e554f6 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 26 Nov 2013 22:24:10 -0700 Subject: [PATCH] fixed a bug in matrix3_transpose - rotate the vector, don't transform the vector --- libobs/graphics/matrix3.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libobs/graphics/matrix3.c b/libobs/graphics/matrix3.c index c12d116f8..512528147 100644 --- a/libobs/graphics/matrix3.c +++ b/libobs/graphics/matrix3.c @@ -111,14 +111,14 @@ void matrix3_scale(struct matrix3 *dst, const struct matrix3 *m, void matrix3_transpose(struct matrix3 *dst, const struct matrix3 *m) { __m128 tmp1, tmp2; - vec3_transform(&dst->t, &m->t, m); + vec3_rotate(&dst->t, &m->t, m); vec3_neg(&dst->t, &dst->t); - tmp1 = _mm_movelh_ps(m->x.m, m->y.m); - tmp2 = _mm_movehl_ps(m->y.m, m->x.m); - dst->x.m = _mm_shuffle_ps(tmp1, m->z.m, _MM_SHUFFLE(3, 0, 2, 0)); - dst->y.m = _mm_shuffle_ps(tmp1, m->z.m, _MM_SHUFFLE(3, 1, 3, 1)); - dst->z.m = _mm_shuffle_ps(tmp2, m->z.m, _MM_SHUFFLE(3, 2, 2, 0)); + tmp1 = _mm_movelh_ps(m->x.m, m->y.m); + tmp2 = _mm_movehl_ps(m->y.m, m->x.m); + dst->x.m = _mm_shuffle_ps(tmp1, m->z.m, _MM_SHUFFLE(3, 0, 2, 0)); + dst->y.m = _mm_shuffle_ps(tmp1, m->z.m, _MM_SHUFFLE(3, 1, 3, 1)); + dst->z.m = _mm_shuffle_ps(tmp2, m->z.m, _MM_SHUFFLE(3, 2, 2, 0)); } void matrix3_inv(struct matrix3 *dst, const struct matrix3 *m)