diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-18 16:51:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-18 16:55:58 +0400 |
commit | dcdb4eaf9cce1f3ff84bbe221ebafd20c2371541 (patch) | |
tree | 794f2700130434d78435166532f0b813e0a0b3f7 /source/blender/editors/space_clip/clip_ops.c | |
parent | 13553876ba3e18f49c2199d9c21f53ff2d8b2e41 (diff) |
NDOF: Fix for fly/walk mode ignoring axis invert options
Diffstat (limited to 'source/blender/editors/space_clip/clip_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 64d96152ba5..6767f92d338 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1333,14 +1333,14 @@ static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv else { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); - float pan_vec[2]; + float pan_vec[3]; wmNDOFMotionData *ndof = (wmNDOFMotionData *) event->customdata; float dt = ndof->dt; /* tune these until it feels right */ - const float pan_sensitivity = 300.0f; /* screen pixels per second */ + const float pan_sensitivity = 300.0f; /* screen pixels per second */ /* "mouse zoom" factor = 1 + (dx + dy) / 300 * what about "ndof zoom" factor? should behave like this: @@ -1348,17 +1348,13 @@ static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv * move forward -> factor > 1 * move backward -> factor < 1 */ - float zoom_factor = dt * - ndof->tvec[2]; - pan_vec[0] = ndof->tvec[0] * ((U.ndof_flag & NDOF_PANX_INVERT_AXIS) ? -1.0f : 1.0f); - pan_vec[1] = ndof->tvec[1] * ((U.ndof_flag & NDOF_PANY_INVERT_AXIS) ? -1.0f : 1.0f); + WM_event_ndof_pan_get(ndof, pan_vec, true); mul_v2_fl(pan_vec, (pan_sensitivity * dt) / sc->zoom); + pan_vec[2] *= -dt; - if (U.ndof_flag & NDOF_ZOOM_INVERT) - zoom_factor = -zoom_factor; - - sclip_zoom_set_factor(C, 1.0f + zoom_factor, NULL); + sclip_zoom_set_factor(C, 1.0f + pan_vec[2], NULL); sc->xof += pan_vec[0]; sc->yof += pan_vec[1]; |