NDOF: support panning when orbiting
Also make orbit the default rotation mode. Based on feedback from T67579, this seems one of the main pain points users are experiencing.
This commit is contained in:
@@ -153,7 +153,8 @@ const UserDef U_default = {
|
||||
.ndof_sensitivity = 1.0,
|
||||
.ndof_orbit_sensitivity = 1.0,
|
||||
.ndof_deadzone = 0.1,
|
||||
.ndof_flag = (NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE),
|
||||
.ndof_flag = (NDOF_MODE_ORBIT | NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM |
|
||||
NDOF_SHOULD_ROTATE),
|
||||
.ogl_multisamples = 0,
|
||||
.image_draw_method = IMAGE_DRAW_METHOD_AUTO,
|
||||
.glalphaclip = 0.004,
|
||||
|
@@ -1432,11 +1432,18 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev
|
||||
}
|
||||
}
|
||||
else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
|
||||
/* Note: based on feedback from T67579, users want to have pan and orbit enabled at once.
|
||||
* It's arguable that orbit shouldn't pan (since we have a pan only operator),
|
||||
* so if there are users who like to separate orbit/pan operations - it can be a preference.
|
||||
*
|
||||
* Also, the 'orbit' and 'free' blocks of code are now very similar.
|
||||
* these could be merged, keep separate until design issues are sorted out - Campbell. */
|
||||
const bool has_rotation = NDOF_HAS_ROTATE;
|
||||
const bool has_translate = !is_zero_v2(ndof->tvec) && NDOF_HAS_TRANSLATE;
|
||||
const bool has_zoom = (ndof->tvec[2] != 0.0f);
|
||||
|
||||
if (has_zoom) {
|
||||
view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, false, has_zoom);
|
||||
if (has_translate || has_zoom) {
|
||||
view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, has_zoom);
|
||||
xform_flag |= HAS_TRANSLATE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user