[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14466] branches/apricot/source/blender/ src/view.c: apricot request, continues view translates the offset ( like fly mode) when auto depth enabled, probably will need a nicer solution for this in trunk.

Campbell Barton ideasman42 at gmail.com
Fri Apr 18 23:28:41 CEST 2008


Revision: 14466
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14466
Author:   campbellbarton
Date:     2008-04-18 23:28:41 +0200 (Fri, 18 Apr 2008)

Log Message:
-----------
apricot request, continues view translates the offset (like fly mode) when auto depth enabled, probably will need a nicer solution for this in trunk.

Modified Paths:
--------------
    branches/apricot/source/blender/src/view.c

Modified: branches/apricot/source/blender/src/view.c
===================================================================
--- branches/apricot/source/blender/src/view.c	2008-04-18 20:55:29 UTC (rev 14465)
+++ branches/apricot/source/blender/src/view.c	2008-04-18 21:28:41 UTC (rev 14466)
@@ -1078,9 +1078,20 @@
 					zfac*G.vd->dist < 10.0*G.vd->far)
 					view_zoom_mouseloc(zfac, mval_area);
 				
-				/* these limits are in toets.c too */
-				if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid;
-				if(G.vd->dist>10.0*G.vd->far) G.vd->dist=10.0*G.vd->far;
+				
+				if ((U.uiflag & USER_ORBIT_ZBUF) && (U.viewzoom==USER_ZOOM_CONT) && (G.vd->persp==V3D_PERSP)) {
+					/* Secret apricot feature, translate the view when in continues mode */
+					upvec[0] = upvec[1] = 0;
+					upvec[2] = G.vd->dist - dist0;
+					G.vd->dist = dist0;
+					Mat3CpyMat4(mat, G.vd->viewinv);
+					Mat3MulVecfl(mat, upvec);
+					VecAddf(G.vd->ofs, G.vd->ofs, upvec);
+				} else {
+					/* these limits are in toets.c too */
+					if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid;
+					if(G.vd->dist>10.0*G.vd->far) G.vd->dist=10.0*G.vd->far;
+				}
 			}
 			if(G.vd->persp==V3D_ORTHO || G.vd->persp==V3D_CAMOB) preview3d_event= 0;
 			




More information about the Bf-blender-cvs mailing list