Browse Source

math: fix a bug in mat3::fromeuler().

legacy
Sam Hocevar sam 12 years ago
parent
commit
fad3e434cf
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/math/vector.cpp

+ 7
- 7
src/math/vector.cpp View File

@@ -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;


Loading…
Cancel
Save