diff options
author | Mike Erwin <significant.bit@gmail.com> | 2011-07-24 04:52:18 +0400 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2011-07-24 04:52:18 +0400 |
commit | c2c62134ccd97eef06822f4c414585bf5d455e16 (patch) | |
tree | d1b8caae2432a60dc8d236a4e502a15f0bfcb824 /intern/ghost | |
parent | ed232c756d25f5fe16370c7eba332f2d78cd128e (diff) |
minor cleanup of Mac ndof manager
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_NDOFManagerCocoa.mm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm index 1c8730a2804..995f73955f2 100644 --- a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm +++ b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm @@ -41,7 +41,7 @@ static void NDOF_DeviceAdded(io_connect_t connection) { printf("ndof: device added\n"); // change these: printf --> informational reports -#if 0 // device preferences will be useful soon +#if 0 // device preferences will be useful some day ConnexionDevicePrefs p; ConnexionGetCurrentDevicePrefs(kDevID_AnyDevice, &p); #endif @@ -74,10 +74,13 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi { case kConnexionCmdHandleAxis: { + // convert to blender view coordinates 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; } @@ -98,7 +101,8 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi break; } case kConnexionMsgPrefsChanged: - printf("ndof: prefs changed\n"); // this includes app switches + // printf("ndof: prefs changed\n"); // this includes app switches + // TODO: look through updated prefs for things blender cares about break; case kConnexionMsgCalibrateDevice: printf("ndof: calibrate\n"); // but what should blender do? @@ -134,7 +138,7 @@ GHOST_NDOFManagerCocoa::GHOST_NDOFManagerCocoa(GHOST_System& sys) m_clientID = RegisterConnexionClient('blnd', (UInt8*) "\007blender", kConnexionClientModeTakeOver, kConnexionMaskAll); - printf("ndof: client id = %d\n", m_clientID); + // printf("ndof: client id = %d\n", m_clientID); if (SetConnexionClientButtonMask != NULL) { @@ -161,7 +165,8 @@ GHOST_NDOFManagerCocoa::~GHOST_NDOFManagerCocoa() bool GHOST_NDOFManagerCocoa::available() { -// extern OSErr InstallConnexionHandlers() __attribute__((weak_import)); -// ^-- not needed since the entire framework is weak-linked + // extern OSErr InstallConnexionHandlers() __attribute__((weak_import)); + // ^^ not needed since the entire framework is weak-linked return InstallConnexionHandlers != NULL; + // this means that the driver is installed and dynamically linked to blender } |