rename mul_project_m4_v4 to mul_project_m4_v3.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 20 May 2011 10:09:03 +0000 (10:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 20 May 2011 10:09:03 +0000 (10:09 +0000)
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/intern/math_matrix.c
source/blender/modifiers/intern/MOD_uvproject.c

index 939c4348461c58f30ae5f96b6c0c8d6111e074cb..d8719f399ae858cf2f1fc502fed12e8074d28d3b 100644 (file)
@@ -84,7 +84,7 @@ void mul_v3_m4v3(float r[3], float M[4][4], float v[3]);
 void mul_mat3_m4_v3(float M[4][4], float r[3]);
 void mul_m4_v4(float M[4][4], float r[4]);
 void mul_v4_m4v4(float r[4], float M[4][4], float v[4]);
-void mul_project_m4_v4(float M[4][4], float r[3]);
+void mul_project_m4_v3(float M[4][4], float vec[3]);
 
 void mul_m3_v3(float M[3][3], float r[3]);
 void mul_v3_m3v3(float r[3], float M[3][3], float a[3]);
index 9fde87d734f329df3156c95c374c89027757c0a5..5edf6e28d4c50d03614cd7041202d07ec8e1b0a8 100644 (file)
@@ -340,11 +340,9 @@ void mul_mat3_m4_v3(float mat[][4], float *vec)
        vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2];
 }
 
-void mul_project_m4_v4(float mat[][4], float *vec)
+void mul_project_m4_v3(float mat[][4], float vec[3])
 {
-       float w;
-
-       w = vec[0]*mat[0][3] + vec[1]*mat[1][3] + vec[2]*mat[2][3] + mat[3][3];
+       const float w= vec[0]*mat[0][3] + vec[1]*mat[1][3] + vec[2]*mat[2][3] + mat[3][3];
        mul_m4_v3(mat, vec);
 
        vec[0] /= w;
index b054a5b0a6ebf1e0f5dff6764f9041b7dbc9acda..a5d2e0b38c7cc5e7f8a26fa3295681a63a041c34 100644 (file)
@@ -271,7 +271,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
        /* if only one projector, project coords to UVs */
        if(num_projectors == 1 && projectors[0].uci==NULL)
                for(i = 0, co = coords; i < numVerts; ++i, ++co)
-                       mul_project_m4_v4(projectors[0].projmat, *co);
+                       mul_project_m4_v3(projectors[0].projmat, *co);
 
        mface = dm->getFaceArray(dm);
        numFaces = dm->getNumFaces(dm);
@@ -345,11 +345,11 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
                                                project_from_camera(tface->uv[3], coords[mf->v4], best_projector->uci);
                                }
                                else {
-                                       mul_project_m4_v4(best_projector->projmat, co1);
-                                       mul_project_m4_v4(best_projector->projmat, co2);
-                                       mul_project_m4_v4(best_projector->projmat, co3);
+                                       mul_project_m4_v3(best_projector->projmat, co1);
+                                       mul_project_m4_v3(best_projector->projmat, co2);
+                                       mul_project_m4_v3(best_projector->projmat, co3);
                                        if(mf->v4)
-                                               mul_project_m4_v4(best_projector->projmat, co4);
+                                               mul_project_m4_v3(best_projector->projmat, co4);
 
                                        /* apply transformed coords as UVs */
                                        tface->uv[0][0] = co1[0];