From fad3e434cf40bdd4acf12970df9971931382215e Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 30 Apr 2012 18:41:00 +0000 Subject: [PATCH] math: fix a bug in mat3::fromeuler(). --- src/math/vector.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/math/vector.cpp b/src/math/vector.cpp index ef9ddf13..58525c9e 100644 --- a/src/math/vector.cpp +++ b/src/math/vector.cpp @@ -519,15 +519,15 @@ template<> mat3 mat3::fromeuler(vec3 const &v) float sz = sin(radians.z), cz = cos(radians.z); ret[0][0] = cy * cz; - ret[1][0] = cx * sz - sx * sy * sz; - ret[2][0] = sx * sz - cx * sy * cz; + ret[1][0] = - cx * sz + sx * sy * cz; + ret[2][0] = sx * sz + cx * sy * cz; - ret[0][1] = - cy * sz; - ret[1][1] = cx * cz - sx * sy * sz; - ret[2][1] = sx * cz + cx * sy * sz; + ret[0][1] = cy * sz; + ret[1][1] = cx * cz + sx * sy * sz; + ret[2][1] = - sx * cz + cx * sy * sz; - ret[0][2] = sy; - ret[1][2] = - sx * cy; + ret[0][2] = - sy; + ret[1][2] = sx * cy; ret[2][2] = cx * cy; return ret;