stricter NDOF guards for Windows (forgot in earlier commit)
[blender.git] / source / blender / windowmanager / intern / wm_event_system.c
index 0dac0bd74015e2cccdea08285a24bfe56e812aa7..258d6bbc025fe95198069f6769a5d0999021de8a 100644 (file)
@@ -2330,26 +2330,28 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
        const float s = U.ndof_sensitivity;
 
        data->tvec[0]= s * ghost->tx;
+
        data->rvec[0]= s * ghost->rx;
+       data->rvec[1]= s * ghost->ry;
+       data->rvec[2]= s * ghost->rz;
 
        if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
                {
-               // swap Y and Z
+               // rotate so Y is where Z was (maintain handed-ness)
                data->tvec[1]= s * ghost->tz;
-               data->tvec[2]= s * ghost->ty;
+               data->tvec[2]= s * -ghost->ty;
 
                // should this affect rotation also?
                // initial guess is 'yes', but get user feedback immediately!
+#if 0  // after turning this on, my guess becomes 'no'
                data->rvec[1]= s * ghost->rz;
                data->rvec[2]= s * ghost->ry;
+#endif
                }
        else
                {
                data->tvec[1]= s * ghost->ty;
                data->tvec[2]= s * ghost->tz;
-
-               data->rvec[1]= s * ghost->ry;
-               data->rvec[2]= s * ghost->rz;
                }
 
        data->dt = ghost->dt;