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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-06-12 03:25:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-12 03:25:38 +0400
commit33b624cb5ff28af208ad95c1cf6d64c45077eb50 (patch)
treeb86591582b53c281e10794b296d2f6c2d60875a7 /source/blender/editors/space_view3d/view3d_view.c
parentbb0b5967111b07ed1a9a82f32420bc4c07215409 (diff)
[#22307] Camera Fly Mode Rolls Camera on local Z-axis
z-roll was enabled by default, also made rotate less sensitive.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 84fe927f4ab..585e3c03e58 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -2005,7 +2005,7 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
fly->axis= 2;
fly->pan_view= FALSE;
fly->xlock= FALSE;
- fly->zlock= TRUE;
+ fly->zlock= FALSE;
fly->xlock_momentum=0.0f;
fly->zlock_momentum=0.0f;
fly->grid= 1.0f;
@@ -2277,6 +2277,11 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
static int flyApply(bContext *C, FlyInfo *fly)
{
+
+#define FLY_ROTATE_FAC 2.5f /* more is faster */
+#define FLY_ZUP_CORRECT_FAC 0.1f /* ammount to correct per step */
+#define FLY_ZUP_CORRECT_ACCEL 0.05f /* increase upright momentum each step */
+
/*
fly mode - Shift+F
a fly loop where the user can move move the view as if they are flying
@@ -2392,7 +2397,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
upvec[1]=0;
upvec[2]=0;
mul_m3_v3(mat, upvec);
- axis_angle_to_quat( tmp_quat, upvec, (float)moffset[1]*-time_redraw*20); /* Rotate about the relative up vec */
+ axis_angle_to_quat( tmp_quat, upvec, (float)moffset[1] * time_redraw * -FLY_ROTATE_FAC); /* Rotate about the relative up vec */
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
if (fly->xlock) fly->xlock = 2; /*check for rotation*/
@@ -2424,7 +2429,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
mul_m3_v3(mat, upvec);
}
- axis_angle_to_quat( tmp_quat, upvec, (float)moffset[0]*time_redraw*20); /* Rotate about the relative up vec */
+ axis_angle_to_quat( tmp_quat, upvec, (float)moffset[0] * time_redraw * FLY_ROTATE_FAC); /* Rotate about the relative up vec */
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
if (fly->xlock) fly->xlock = 2;/*check for rotation*/
@@ -2445,10 +2450,10 @@ static int flyApply(bContext *C, FlyInfo *fly)
upvec[2]=1;
mul_m3_v3(mat, upvec);
- axis_angle_to_quat( tmp_quat, upvec, roll*time_redraw_clamped*fly->zlock_momentum*0.1); /* Rotate about the relative up vec */
+ axis_angle_to_quat( tmp_quat, upvec, roll*time_redraw_clamped*fly->zlock_momentum * FLY_ZUP_CORRECT_FAC); /* Rotate about the relative up vec */
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
- fly->zlock_momentum += 0.05f;
+ fly->zlock_momentum += FLY_ZUP_CORRECT_ACCEL;
} else {
fly->zlock=1; /* dont check until the view rotates again */
fly->zlock_momentum= 0.0f;