~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to source/blender/editors/space_view3d/view3d_fly.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
        WM_modalkeymap_add_item(keymap, RKEY, KM_PRESS, 0, 0, FLY_MODAL_DIR_UP);
160
160
        WM_modalkeymap_add_item(keymap, FKEY, KM_PRESS, 0, 0, FLY_MODAL_DIR_DOWN);
161
161
 
 
162
        WM_modalkeymap_add_item(keymap, UPARROWKEY, KM_PRESS, 0, 0, FLY_MODAL_DIR_FORWARD);
 
163
        WM_modalkeymap_add_item(keymap, DOWNARROWKEY, KM_PRESS, 0, 0, FLY_MODAL_DIR_BACKWARD);
 
164
        WM_modalkeymap_add_item(keymap, LEFTARROWKEY, KM_PRESS, 0, 0, FLY_MODAL_DIR_LEFT);
 
165
        WM_modalkeymap_add_item(keymap, RIGHTARROWKEY, KM_PRESS, 0, 0, FLY_MODAL_DIR_RIGHT);
 
166
 
162
167
        WM_modalkeymap_add_item(keymap, XKEY, KM_PRESS, 0, 0, FLY_MODAL_AXIS_LOCK_X);
163
168
        WM_modalkeymap_add_item(keymap, ZKEY, KM_PRESS, 0, 0, FLY_MODAL_AXIS_LOCK_Z);
164
169
 
518
523
#ifdef NDOF_FLY_DEBUG
519
524
                                puts("start keeping track of 3D mouse position");
520
525
#endif
521
 
                        /* fall through... */
 
526
                                /* fall-through */
522
527
                        case P_IN_PROGRESS:
523
528
                                /* update 3D mouse position */
524
529
#ifdef NDOF_FLY_DEBUG
580
585
                                double time_currwheel;
581
586
                                float time_wheel;
582
587
 
 
588
                                /* not quite correct but avoids confusion WASD/arrow keys 'locking up' */
 
589
                                if (fly->axis == -1) {
 
590
                                        fly->axis = 2;
 
591
                                        fly->speed = fabsf(fly->speed);
 
592
                                }
 
593
 
583
594
                                time_currwheel = PIL_check_seconds_timer();
584
595
                                time_wheel = (float)(time_currwheel - fly->time_lastwheel);
585
596
                                fly->time_lastwheel = time_currwheel;
599
610
                                double time_currwheel;
600
611
                                float time_wheel;
601
612
 
 
613
                                /* not quite correct but avoids confusion WASD/arrow keys 'locking up' */
 
614
                                if (fly->axis == -1) {
 
615
                                        fly->axis = 2;
 
616
                                        fly->speed = -fabsf(fly->speed);
 
617
                                }
 
618
 
602
619
                                time_currwheel = PIL_check_seconds_timer();
603
620
                                time_wheel = (float)(time_currwheel - fly->time_lastwheel);
604
621
                                fly->time_lastwheel = time_currwheel;
806
823
 
807
824
static int flyApply(bContext *C, FlyInfo *fly)
808
825
{
809
 
#define FLY_ROTATE_FAC 2.5f /* more is faster */
 
826
#define FLY_ROTATE_FAC 10.0f /* more is faster */
810
827
#define FLY_ZUP_CORRECT_FAC 0.1f /* amount to correct per step */
811
828
#define FLY_ZUP_CORRECT_ACCEL 0.05f /* increase upright momentum each step */
 
829
#define FLY_SMOOTH_FAC 20.0f  /* higher value less lag */
812
830
 
813
831
        /* fly mode - Shift+F
814
832
         * a fly loop where the user can move move the view as if they are flying
1052
1070
                        }
1053
1071
 
1054
1072
                        /* impose a directional lag */
1055
 
                        interp_v3_v3v3(dvec, dvec_tmp, fly->dvec_prev, (1.0f / (1.0f + (time_redraw * 5.0f))));
 
1073
                        interp_v3_v3v3(dvec, dvec_tmp, fly->dvec_prev, (1.0f / (1.0f + (time_redraw * FLY_SMOOTH_FAC))));
1056
1074
 
1057
1075
                        if (rv3d->persp == RV3D_CAMOB) {
1058
1076
                                Object *lock_ob = fly->root_parent ? fly->root_parent : fly->v3d->camera;