Made RotationMatrix accept values outside 360,

added object.type to be used instead of .getType()
This commit is contained in:
2006-08-08 14:34:38 +00:00
parent fde5381a94
commit b44ae44c72
2 changed files with 9 additions and 3 deletions

View File

@@ -656,9 +656,13 @@ PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args)
return EXPP_ReturnPyObjError (PyExc_TypeError,
"Mathutils.RotationMatrix(): expected float int and optional string and vector\n");
}
if(angle < -360.0f || angle > 360.0f)
return EXPP_ReturnPyObjError(PyExc_AttributeError,
"Mathutils.RotationMatrix(): angle size not appropriate\n");
/* Clamp to -360:360 */
while (angle<-360.0f)
angle+=360.0;
while (angle>360.0f)
angle-=360.0;
if(matSize != 2 && matSize != 3 && matSize != 4)
return EXPP_ReturnPyObjError(PyExc_AttributeError,
"Mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n");