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:
Diffstat (limited to 'source/blender/editors/space_clip/clip_ops.c')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c14
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];