Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-04-02 16:36:00 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-04-02 16:36:00 +0400
commitb07f9446c7b28ec1a8a72c29f44af505fdfe346e (patch)
tree3a6ecc147a18c68f7e8c92b52a47fa5e3c2232f7 /source/blender/python/mathutils
parent4458ce1abaea10256d19090d0ca1efa2c23f402c (diff)
Hopefully last change to matrix orthogonal check, touches Py API only
- is_orthogonal now checks matrix in the same way as it's defined by linear algebra, meaning that it'll use is_orhonormal C check - Added is_orthogonal_axis_vectors to check if vectors which defines axises are orthogonal
Diffstat (limited to 'source/blender/python/mathutils')
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index f5f54356680..bd37b645cbb 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -2219,9 +2219,9 @@ static PyObject *Matrix_is_orthogonal_get(MatrixObject *self, void *UNUSED(closu
/*must be 3-4 cols, 3-4 rows, square matrix*/
if (self->num_row == 4 && self->num_col == 4)
- return PyBool_FromLong(is_orthogonal_m4((float (*)[4])self->matrix));
+ return PyBool_FromLong(is_orthonormal_m4((float (*)[4])self->matrix));
else if (self->num_row == 3 && self->num_col == 3)
- return PyBool_FromLong(is_orthogonal_m3((float (*)[3])self->matrix));
+ return PyBool_FromLong(is_orthonormal_m3((float (*)[3])self->matrix));
else {
PyErr_SetString(PyExc_AttributeError,
"Matrix.is_orthogonal: "
@@ -2230,22 +2230,22 @@ static PyObject *Matrix_is_orthogonal_get(MatrixObject *self, void *UNUSED(closu
}
}
-PyDoc_STRVAR(Matrix_is_orthonormal_doc,
-"True if this matrix is orthonormal, 3x3 and 4x4 only, (read-only).\n\n:type: bool"
+PyDoc_STRVAR(Matrix_is_orthogonal_axis_vectors_doc,
+"True if this matrix has got orthogonal axis vectors, 3x3 and 4x4 only, (read-only).\n\n:type: bool"
);
-static PyObject *Matrix_is_orthonormal_get(MatrixObject *self, void *UNUSED(closure))
+static PyObject *Matrix_is_orthogonal_axis_vectors_get(MatrixObject *self, void *UNUSED(closure))
{
if (BaseMath_ReadCallback(self) == -1)
return NULL;
/*must be 3-4 cols, 3-4 rows, square matrix*/
if (self->num_row == 4 && self->num_col == 4)
- return PyBool_FromLong(is_orthonormal_m4((float (*)[4])self->matrix));
+ return PyBool_FromLong(is_orthogonal_m4((float (*)[4])self->matrix));
else if (self->num_row == 3 && self->num_col == 3)
- return PyBool_FromLong(is_orthonormal_m3((float (*)[3])self->matrix));
+ return PyBool_FromLong(is_orthogonal_m3((float (*)[3])self->matrix));
else {
PyErr_SetString(PyExc_AttributeError,
- "Matrix.is_orthonormal: "
+ "Matrix.is_orthogonal_axis_vectors: "
"inappropriate matrix size - expects 3x3 or 4x4 matrix");
return NULL;
}
@@ -2261,7 +2261,7 @@ static PyGetSetDef Matrix_getseters[] = {
{(char *)"col", (getter)Matrix_col_get, (setter)NULL, Matrix_col_doc, NULL},
{(char *)"is_negative", (getter)Matrix_is_negative_get, (setter)NULL, Matrix_is_negative_doc, NULL},
{(char *)"is_orthogonal", (getter)Matrix_is_orthogonal_get, (setter)NULL, Matrix_is_orthogonal_doc, NULL},
- {(char *)"is_orthonormal", (getter)Matrix_is_orthonormal_get, (setter)NULL, Matrix_is_orthonormal_doc, NULL},
+ {(char *)"is_orthogonal_axis_vectors", (getter)Matrix_is_orthogonal_axis_vectors_get, (setter)NULL, Matrix_is_orthogonal_axis_vectors_doc, NULL},
{(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
{(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */