From 1fc26457f4eef234d16ebe3769ddbb377dcc5489 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 3 Dec 2004 21:25:56 +0000 Subject: [PATCH] Bug fix #1952 When rotating camera itself in camera view, and choose local axis rotate, the camera flipped around. Was due to using viewmat[][] while it changes... Solved in the simplest elegant way; hope Martin will cope with this in new transform! --- source/blender/src/editobject.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index cef0bae07d5..b15b4b5d976 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -5544,11 +5544,13 @@ void transform(int mode) VECCOPY(vec, tob->axismat[2]); } /* Correct the vector */ - if ((axismode & TRANSLOCAL) && ((G.vd->viewmat[0][2] * vec[0]+G.vd->viewmat[1][2] * vec[1]+G.vd->viewmat[2][2] * vec[2])>0)){ - vec[0]*=-1; - vec[1]*=-1; - vec[2]*=-1; - } + if(cameragrab==0) { // because viewmat changes continious then + if ((axismode & TRANSLOCAL) && ((G.vd->viewmat[0][2] * vec[0]+G.vd->viewmat[1][2] * vec[1]+G.vd->viewmat[2][2] * vec[2])>0)){ + vec[0]*=-1; + vec[1]*=-1; + vec[2]*=-1; + } + } if (typemode) VecRotToMat3(vec, addvec[0] * M_PI / 180.0, mat);