NDOF: minor tweaks based on feedback.

- invert Y axis when swap YZ is enabled.
- allow rotating when not in ortho mode.
This commit is contained in:
2014-02-28 22:07:53 +11:00
parent f4bf97729a
commit a04c132a7e
2 changed files with 5 additions and 8 deletions

View 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);

View 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;