rename internal matrix struct member vars to avoid confusion

Matrix.contigPtr --> matrix
Matrix.row_size --> num_col
Matrix.col_size --> num_row
This commit is contained in:
2011-12-20 04:11:23 +00:00
parent 3d8ee28750
commit a8ed803b66
8 changed files with 164 additions and 164 deletions

View File

@@ -1189,7 +1189,7 @@ static PyObject *Vector_str(VectorObject *self)
BLI_dynstr_appendf(ds, i ? ", %.4f" : "%.4f", self->vec[i]);
}
BLI_dynstr_append(ds, ") >");
BLI_dynstr_append(ds, ")>");
return mathutils_dynstr_to_py(ds); /* frees ds */
}
@@ -1492,8 +1492,8 @@ int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject* vec,
double dot = 0.0f;
int x, y, z = 0;
if (mat->row_size != vec->size) {
if (mat->row_size == 4 && vec->size == 3) {
if (mat->num_col != vec->size) {
if (mat->num_col == 4 && vec->size == 3) {
vec_cpy[3] = 1.0f;
}
else {
@@ -1509,8 +1509,8 @@ int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject* vec,
rvec[3] = 1.0f;
for (x = 0; x < mat->col_size; x++) {
for (y = 0; y < mat->row_size; y++) {
for (x = 0; x < mat->num_row; x++) {
for (y = 0; y < mat->num_col; y++) {
dot += (double)(MATRIX_ITEM(mat, y, x) * vec_cpy[y]);
}
rvec[z++] = (float)dot;
@@ -2613,8 +2613,8 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
double dot = 0.0f;
int x, y, z= 0, vec_size= vec->size;
if (mat->col_size != vec_size) {
if (mat->col_size == 4 && vec_size != 3) {
if (mat->num_row != vec_size) {
if (mat->num_row == 4 && vec_size != 3) {
PyErr_SetString(PyExc_ValueError,
"vector * matrix: matrix column size "
"and the vector size must be the same");
@@ -2632,8 +2632,8 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
rvec[3] = 1.0f;
//muliplication
for (x = 0; x < mat->row_size; x++) {
for (y = 0; y < mat->col_size; y++) {
for (x = 0; x < mat->num_col; x++) {
for (y = 0; y < mat->num_row; y++) {
dot += MATRIX_ITEM(mat, x, y) * vec_cpy[y];
}
rvec[z++] = (float)dot;