Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--intern/ghost/intern/GHOST_NDOFManagerCocoa.mm9
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
index 919e4e37f16..e32c21eab15 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
+++ b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
@@ -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;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 0e82581e411..15c3d9da84f 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -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;