* [ #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:
@@ -186,6 +186,10 @@ static PyObject *Quaternion_getattr(QuaternionObject * self, char *name)
|
|||||||
vec[x] = (float)(self->quat[x + 1] / mag);
|
vec[x] = (float)(self->quat[x + 1] / mag);
|
||||||
}
|
}
|
||||||
Normalise(vec);
|
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);
|
return (PyObject *) newVectorObject(vec, 3, Py_NEW);
|
||||||
}
|
}
|
||||||
if(STREQ(name, "wrapped")){
|
if(STREQ(name, "wrapped")){
|
||||||
|
|||||||
Reference in New Issue
Block a user