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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-20 15:37:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-20 15:37:55 +0400
commitea88a0bec5317fbd84dd2f9128dbae8a50d3863e (patch)
tree9ffe0802f3ec27bdc8674cd952ab1797bd3dc612 /source
parentb70174cb9350868e9dd26139a8980406b18415b8 (diff)
recent commit missed swapping args for MATRIX_ITEM in mathutils_Vector.c, breaking matrix*vector.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 25760910c4e..bd121b6177f 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -1486,11 +1486,11 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
* note: vector/matrix multiplication IS NOT COMMUTATIVE!!!!
* note: assume read callbacks have been done first.
*/
-int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject* vec, MatrixObject * mat)
+int column_vector_multiplication(float r_vec[MAX_DIMENSIONS], VectorObject* vec, MatrixObject * mat)
{
float vec_cpy[MAX_DIMENSIONS];
double dot = 0.0f;
- int x, y, z = 0;
+ int row, col, z = 0;
if (mat->num_col != vec->size) {
if (mat->num_col == 4 && vec->size == 3) {
@@ -1507,13 +1507,13 @@ int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject* vec,
memcpy(vec_cpy, vec->vec, vec->size * sizeof(float));
- rvec[3] = 1.0f;
+ r_vec[3] = 1.0f;
- 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]);
+ for (row = 0; row < mat->num_row; row++) {
+ for (col = 0; col < mat->num_col; col++) {
+ dot += (double)(MATRIX_ITEM(mat, row, col) * vec_cpy[col]);
}
- rvec[z++] = (float)dot;
+ r_vec[z++] = (float)dot;
dot = 0.0f;
}
@@ -2634,7 +2634,7 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
//muliplication
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];
+ dot += MATRIX_ITEM(mat, y, x) * vec_cpy[y];
}
rvec[z++] = (float)dot;
dot = 0.0f;