Mac ndof using blender view coordinates + small but important typo fixed
authorMike Erwin <significant.bit@gmail.com>
Mon, 27 Jun 2011 20:44:23 +0000 (20:44 +0000)
committerMike Erwin <significant.bit@gmail.com>
Mon, 27 Jun 2011 20:44:23 +0000 (20:44 +0000)
intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
source/blender/editors/space_view3d/view3d_edit.c

index 919e4e37f16e21aed4498913aada8da94891b241..e32c21eab158fc643e66a6b6581d398c107abf0b 100644 (file)
@@ -73,11 +73,14 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi
                        switch (s->command)
                                {
                                case kConnexionCmdHandleAxis:
-                                       ndof_manager->updateTranslation(s->axis, now);
-                                       ndof_manager->updateRotation(s->axis + 3, now);
+                                       {
+                                       short t[3] = {s->axis[0], -(s->axis[2]), s->axis[1]};
+                                       short r[3] = {-(s->axis[3]), s->axis[5], -(s->axis[4])};
+                                       ndof_manager->updateTranslation(t, now);
+                                       ndof_manager->updateRotation(r, now);
                                        ghost_system->notifyExternalEventProcessed();
                                        break;
-
+                                       }
                                case kConnexionCmdHandleButtons:
                                        {
                                        int button_bits = has_old_driver ? s->buttons8 : s->buttons;
index 0e82581e411a7fd0405ec68a5dedb61feab05509..15c3d9da84fe3bdd765797564ee5c34e6558a61e 100644 (file)
@@ -997,11 +997,11 @@ static int viewndof_invoke(bContext *C, wmOperator *op, wmEvent *event)
                ndof->dt = dt = 0.0125f;
 
 
-       if (ndof->ty) {
+       if (ndof->tz) {
                // Zoom!
                // velocity should be proportional to the linear velocity attained by rotational motion of same strength
                // [got that?]
-               // proportional to s = r * theta
+               // proportional to arclength = radius * angle
 
                float zoom_distance = zoom_sensitivity * rv3d->dist * dt * ndof->tz;
                rv3d->dist += zoom_distance;