* [ #3376 ] Blender.Mathutils.Matrix().toQuat() broken

- a 0-degree rotation gives a abitrary axis of 1,0,0 not 0,0,0
This commit is contained in:
2005-11-21 19:42:20 +00:00
parent e9ea05815d
commit d5f1fc13b7

View File

@@ -186,6 +186,10 @@ static PyObject *Quaternion_getattr(QuaternionObject * self, char *name)
vec[x] = (float)(self->quat[x + 1] / mag);
}
Normalise(vec);
//If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations
if (vec[0] < 1e-44 && vec[1] < 1e-44 && vec[2] < 1e-44){
vec[0] = 1.0f;
}
return (PyObject *) newVectorObject(vec, 3, Py_NEW);
}
if(STREQ(name, "wrapped")){