formatting edits & doc correction, no functional changes.

This commit is contained in:
2011-11-16 03:56:34 +00:00
parent 9d31c99c26
commit ba7fbf6ae7
5 changed files with 138 additions and 132 deletions

View File

@@ -941,8 +941,10 @@ static PyObject *Matrix_invert(MatrixObject *self)
int x, y, z = 0; int x, y, z = 0;
float det = 0.0f; float det = 0.0f;
float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f};
if (BaseMath_ReadCallback(self) == -1) if (BaseMath_ReadCallback(self) == -1)
return NULL; return NULL;
@@ -964,9 +966,11 @@ static PyObject *Matrix_invert(MatrixObject *self)
mat[1] = -self->matrix[0][1]; mat[1] = -self->matrix[0][1];
mat[2] = -self->matrix[1][0]; mat[2] = -self->matrix[1][0];
mat[3] = self->matrix[0][0]; mat[3] = self->matrix[0][0];
} else if (self->row_size == 3) { }
else if (self->row_size == 3) {
adjoint_m3_m3((float (*)[3]) mat,(float (*)[3])self->contigPtr); adjoint_m3_m3((float (*)[3]) mat,(float (*)[3])self->contigPtr);
} else if (self->row_size == 4) { }
else if (self->row_size == 4) {
adjoint_m4_m4((float (*)[4]) mat, (float (*)[4])self->contigPtr); adjoint_m4_m4((float (*)[4]) mat, (float (*)[4])self->contigPtr);
} }
/*divide by determinate*/ /*divide by determinate*/
@@ -1183,7 +1187,8 @@ static PyObject *Matrix_transpose(MatrixObject *self)
t = self->matrix[1][0]; t = self->matrix[1][0];
self->matrix[1][0] = self->matrix[0][1]; self->matrix[1][0] = self->matrix[0][1];
self->matrix[0][1] = t; self->matrix[0][1] = t;
} else if (self->row_size == 3) { }
else if (self->row_size == 3) {
transpose_m3((float (*)[3])self->contigPtr); transpose_m3((float (*)[3])self->contigPtr);
} }
else { else {
@@ -1253,7 +1258,8 @@ static PyObject *Matrix_identity(MatrixObject *self)
self->matrix[0][1] = 0.0f; self->matrix[0][1] = 0.0f;
self->matrix[1][0] = 0.0f; self->matrix[1][0] = 0.0f;
self->matrix[1][1] = 1.0f; self->matrix[1][1] = 1.0f;
} else if (self->row_size == 3) { }
else if (self->row_size == 3) {
unit_m3((float (*)[3])self->contigPtr); unit_m3((float (*)[3])self->contigPtr);
} }
else { else {
@@ -1657,7 +1663,8 @@ static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
if (i < 0) if (i < 0)
i += self->row_size; i += self->row_size;
return Matrix_item(self, i); return Matrix_item(self, i);
} else if (PySlice_Check(item)) { }
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength; Py_ssize_t start, stop, step, slicelength;
if (PySlice_GetIndicesEx((void *)item, self->row_size, &start, &stop, &step, &slicelength) < 0) if (PySlice_GetIndicesEx((void *)item, self->row_size, &start, &stop, &step, &slicelength) < 0)

View File

@@ -639,7 +639,8 @@ static PyObject *Quaternion_subscript(QuaternionObject *self, PyObject *item)
if (i < 0) if (i < 0)
i += QUAT_SIZE; i += QUAT_SIZE;
return Quaternion_item(self, i); return Quaternion_item(self, i);
} else if (PySlice_Check(item)) { }
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength; Py_ssize_t start, stop, step, slicelength;
if (PySlice_GetIndicesEx((void *)item, QUAT_SIZE, &start, &stop, &step, &slicelength) < 0) if (PySlice_GetIndicesEx((void *)item, QUAT_SIZE, &start, &stop, &step, &slicelength) < 0)

View File

@@ -648,7 +648,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
} }
PyDoc_STRVAR(Vector_rotation_difference_doc, PyDoc_STRVAR(Vector_rotation_difference_doc,
".. function:: difference(other)\n" ".. function:: rotation_difference(other)\n"
"\n" "\n"
" Returns a quaternion representing the rotational difference between this\n" " Returns a quaternion representing the rotational difference between this\n"
" vector and another.\n" " vector and another.\n"

View File

@@ -48,8 +48,6 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#define SWAP_FLOAT(a, b, tmp) tmp=a; a=b; b=tmp #define SWAP_FLOAT(a, b, tmp) tmp=a; a=b; b=tmp
#define eps 0.000001
/*-------------------------DOC STRINGS ---------------------------*/ /*-------------------------DOC STRINGS ---------------------------*/
PyDoc_STRVAR(M_Geometry_doc, PyDoc_STRVAR(M_Geometry_doc,