mathutils: support Vector.rotate for 2D vectors

This commit is contained in:
Tiago Chaves
2020-02-20 13:57:32 +11:00
committed by Campbell Barton
parent 0115568ca6
commit bc86eb1780
3 changed files with 45 additions and 16 deletions

View File

@@ -3306,6 +3306,23 @@ int Matrix_ParseAny(PyObject *o, void *p)
return 1;
}
int Matrix_Parse2x2(PyObject *o, void *p)
{
MatrixObject **pymat_p = p;
MatrixObject *pymat = (MatrixObject *)o;
if (!Matrix_ParseCheck(pymat)) {
return 0;
}
if ((pymat->num_col != 2) || (pymat->num_row != 2)) {
PyErr_SetString(PyExc_ValueError, "matrix must be 2x2");
return 0;
}
*pymat_p = pymat;
return 1;
}
int Matrix_Parse3x3(PyObject *o, void *p)
{
MatrixObject **pymat_p = p;