NDOF: minor tweaks based on feedback.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 28 Feb 2014 11:07:53 +0000 (22:07 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 28 Feb 2014 11:07:53 +0000 (22:07 +1100)
- invert Y axis when swap YZ is enabled.
- allow rotating when not in ortho mode.

source/blender/editors/space_view3d/view3d_edit.c
source/blender/windowmanager/intern/wm_event_system.c

index e8b08f3dd07cb6ead0c75508bbeaec7607580d31..cf593a68d77f0af2ddc0b42136f70b3aca655975 100644 (file)
@@ -1548,7 +1548,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev
                if (ndof->progress == P_FINISHING) {
                        /* pass */
                }
-               else if (RV3D_VIEW_IS_AXIS(rv3d->view)) {
+               else if ((rv3d->persp == RV3D_ORTHO) && RV3D_VIEW_IS_AXIS(rv3d->view)) {
                        /* if we can't rotate, fallback to translate (locked axis views) */
                        const bool has_translate = NDOF_HAS_TRANSLATE;
                        const bool has_zoom = (ndof->tvec[2] != 0.0f) && ED_view3d_offset_lock_check(v3d, rv3d);
index 6a70be364198bc2c4c2177034f129b60e7885018..ecf56bcbc3afced1cbacd1d787aa839a508e3fb3 100644 (file)
@@ -2883,14 +2883,11 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g
        mul_v3_v3fl(data->tvec, &ghost->tx, ts);
        mul_v3_v3fl(data->rvec, &ghost->rx, rs);
 
-       /**
-        * \note
-        * - optionally swap Y/Z.
-        * - maintain handed-ness? or just do what feels right? not for now.
-        * - after testing seems best not to apply this to rotation.
-        */
        if (U.ndof_flag & NDOF_PAN_YZ_SWAP_AXIS) {
-               SWAP(float, data->tvec[1], data->tvec[2]);
+               float t;
+               t =  data->tvec[1];
+               data->tvec[1] = -data->tvec[2];
+               data->tvec[2] = t;
        }
 
        data->dt = ghost->dt;