diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-08-03 18:22:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-08-03 18:31:25 +0300 |
commit | e82b7f15270eb4e4dbcd119ea09d1f0204f1dc11 (patch) | |
tree | a3250de9f9d1ffa7a71737c19fcf80ac18b445ff /source/blender/editors/space_view3d | |
parent | 27aef8b551bd30817bac13cfe77d5a142ac0d037 (diff) |
3D View: preferences for rotate sensitivity
Added because the current default is too fast
for painting with tablets, see D5385.
Turntable and trackball have different settings because
turn-table uses an angle-per-pixel, where as trackball
values are relative to the view-port size so a scale is used.
The sensitivity is scaled by the pixel size so hi-dpi views don't rotate faster.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 0d0cfce07d7..62673d9bd5a 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -729,6 +729,10 @@ static void viewrotate_apply(ViewOpsData *vod, const int event_xy[2]) angle = (len_v3(dvec) / (2.0f * TRACKBALLSIZE)) * (float)M_PI; + /* Before applying the sensitivity this is rotating 1:1, + * where the cursor would match the surface of a sphere in the view. */ + angle *= U.view_rotate_sensitivity_trackball; + /* Allow for rotation beyond the interval [-pi, pi] */ angle = angle_wrap_rad(angle); @@ -751,11 +755,8 @@ static void viewrotate_apply(ViewOpsData *vod, const int event_xy[2]) const float zvec_global[3] = {0.0f, 0.0f, 1.0f}; float xaxis[3]; - /* Sensitivity will control how fast the viewport rotates. 0.007 was - * obtained experimentally by looking at viewport rotation sensitivities - * on other modeling programs. */ - /* Perhaps this should be a configurable user parameter. */ - const float sensitivity = 0.007f; + /* Radians per-pixel. */ + const float sensitivity = U.view_rotate_sensitivity_turntable / U.pixelsize; /* Get the 3x3 matrix and its inverse from the quaternion */ quat_to_mat3(m, vod->curr.viewquat); |