Merged changes in the trunk up to revision 28536.
[blender.git] / source / blender / editors / space_view3d / view3d_edit.c
index 4e41314ef20b3486e4ce2366a3bbb394d9651622..89513c11feac736d100c9a50d5ee5bb022bba335 100644 (file)
@@ -542,9 +542,9 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
 
                        conjugate_qt(q1); /* conj == inv for unit quat */
                        VECCOPY(rv3d->ofs, vod->ofs);
-                       sub_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs);
+                       sub_v3_v3(rv3d->ofs, vod->dyn_ofs);
                        mul_qt_v3(q1, rv3d->ofs);
-                       add_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs);
+                       add_v3_v3(rv3d->ofs, vod->dyn_ofs);
                }
        }
        else {
@@ -575,9 +575,9 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
 
                if (vod->use_dyn_ofs) {
                        conjugate_qt(q1); /* conj == inv for unit quat */
-                       sub_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs);
+                       sub_v3_v3(rv3d->ofs, vod->dyn_ofs);
                        mul_qt_v3(q1, rv3d->ofs);
-                       add_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs);
+                       add_v3_v3(rv3d->ofs, vod->dyn_ofs);
                }
 
                /* Perform the orbital rotation */
@@ -589,9 +589,9 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
 
                if (vod->use_dyn_ofs) {
                        conjugate_qt(q1);
-                       sub_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs);
+                       sub_v3_v3(rv3d->ofs, vod->dyn_ofs);
                        mul_qt_v3(q1, rv3d->ofs);
-                       add_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs);
+                       add_v3_v3(rv3d->ofs, vod->dyn_ofs);
                }
        }
 
@@ -801,7 +801,7 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y)
                float dvec[3];
 
                window_to_3d_delta(vod->ar, dvec, x-vod->oldx, y-vod->oldy);
-               add_v3_v3v3(vod->rv3d->ofs, vod->rv3d->ofs, dvec);
+               add_v3_v3(vod->rv3d->ofs, dvec);
 
                if(vod->rv3d->viewlock & RV3D_BOXVIEW)
                        view3d_boxview_sync(vod->sa, vod->ar);
@@ -1022,7 +1022,7 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, short viewzoom)
                vod->rv3d->dist = vod->dist0;
                copy_m3_m4(mat, vod->rv3d->viewinv);
                mul_m3_v3(mat, upvec);
-               add_v3_v3v3(vod->rv3d->ofs, vod->rv3d->ofs, upvec);
+               add_v3_v3(vod->rv3d->ofs, upvec);
        } else {
                /* these limits were in old code too */
                if(vod->rv3d->dist<0.001*vod->grid) vod->rv3d->dist= 0.001*vod->grid;
@@ -1675,7 +1675,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
 
                        window_to_3d_delta(ar, dvec, (rect.xmin+rect.xmax-vb[0])/2, (rect.ymin+rect.ymax-vb[1])/2);
                        /* center the view to the center of the rectangle */
-                       sub_v3_v3v3(new_ofs, new_ofs, dvec);
+                       sub_v3_v3(new_ofs, dvec);
                }
 
                /* work out the ratios, so that everything selected fits when we zoom */
@@ -2298,7 +2298,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
                if(depth_used==0) {
                        window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my);
-                       sub_v3_v3v3(fp, fp, dvec);
+                       sub_v3_v3(fp, dvec);
                }
        }
        else {
@@ -2706,7 +2706,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode)
                upvec[2] = rv3d->dist;
                copy_m3_m4(mat, rv3d->viewinv);
                mul_m3_v3(mat, upvec);
-               sub_v3_v3v3(rv3d->ofs, rv3d->ofs, upvec);
+               sub_v3_v3(rv3d->ofs, upvec);
                rv3d->dist = 0.0;
        }
 
@@ -2748,7 +2748,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode)
 
        // translate the view
 
-       sub_v3_v3v3(rv3d->ofs, rv3d->ofs, tvec);
+       sub_v3_v3(rv3d->ofs, tvec);
 
 
        /*----------------------------------------------------
@@ -2809,7 +2809,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
                upvec[2] = rv3d->dist;
                copy_m3_m4(mat, rv3d->viewinv);
                mul_m3_v3(mat, upvec);
-               add_v3_v3v3(rv3d->ofs, rv3d->ofs, upvec);
+               add_v3_v3(rv3d->ofs, upvec);
        }
 
        /*----------------------------------------------------
@@ -2887,7 +2887,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
        dvec[0] = curareaX * rv3d->persinv[0][0] + curareaY * rv3d->persinv[1][0];
        dvec[1] = curareaX * rv3d->persinv[0][1] + curareaY * rv3d->persinv[1][1];
        dvec[2] = curareaX * rv3d->persinv[0][2] + curareaY * rv3d->persinv[1][2];
-       add_v3_v3v3(rv3d->ofs, rv3d->ofs, dvec);
+       add_v3_v3(rv3d->ofs, dvec);
 
        /*----------------------------------------------------
         * ndof device dolly
@@ -2929,9 +2929,9 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
 
        if (use_sel) {
                conjugate_qt(q1); /* conj == inv for unit quat */
-               sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+               sub_v3_v3(rv3d->ofs, obofs);
                mul_qt_v3(q1, rv3d->ofs);
-               add_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+               add_v3_v3(rv3d->ofs, obofs);
        }
 
        /* Perform the orbital rotation */
@@ -2954,9 +2954,9 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
 
        if (use_sel) {
                conjugate_qt(q1);
-               sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+               sub_v3_v3(rv3d->ofs, obofs);
                mul_qt_v3(q1, rv3d->ofs);
-               add_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+               add_v3_v3(rv3d->ofs, obofs);
        }
 
        /*----------------------------------------------------