Fix T40001: Opening a 2.66 blend file in 2.7, a bone appear "rolled but not rolled".

Looks like some sign was lost in that complex matrix algebra (always be wary of squared values!).
This commit is contained in:
Bastien Montagne 2014-05-03 08:49:29 +02:00
parent 35a9a7d396
commit 39dc3bce30
Notes: blender-bot 2023-02-14 10:42:35 +01:00
Referenced by issue #40001, Opening a 2.66 blend file in 2.7, a bone appear "rolled but not rolled"
1 changed files with 1 additions and 1 deletions

View File

@ -1522,7 +1522,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[3][3])
else {
/* If nor is too close to -Y, apply the special case. */
theta = nor[0] * nor[0] + nor[2] * nor[2];
bMatrix[0][0] = (nor[0] + nor[2]) * (nor[0] - nor[2]) / theta;
bMatrix[0][0] = (nor[0] + nor[2]) * (nor[0] - nor[2]) / -theta;
bMatrix[2][2] = -bMatrix[0][0];
bMatrix[2][0] = bMatrix[0][2] = 2.0f * nor[0] * nor[2] / theta;
}