From b9bf935cc32d456d6d8ada8ec24fe809698d295b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 12 Feb 2014 19:30:58 +1100 Subject: NDOF/X11: fix for glitch using ndof outside the view and entering again --- intern/ghost/intern/GHOST_NDOFManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp index d62d4437972..f8c707b668c 100644 --- a/intern/ghost/intern/GHOST_NDOFManager.cpp +++ b/intern/ghost/intern/GHOST_NDOFManager.cpp @@ -432,6 +432,7 @@ bool GHOST_NDOFManager::sendMotionEvent() GHOST_IWindow *window = m_system.getWindowManager()->getActiveWindow(); if (window == NULL) { + m_motionState = GHOST_kNotStarted; // avoid large 'dt' times when changing windows return false; // delivery will fail, so don't bother sending } @@ -452,6 +453,7 @@ bool GHOST_NDOFManager::sendMotionEvent() data->rz = scale * m_rotation[2]; data->dt = 0.001f * (m_motionTime - m_prevMotionTime); // in seconds + m_prevMotionTime = m_motionTime; bool weHaveMotion = !nearHomePosition(data, m_deadZone); @@ -468,6 +470,9 @@ bool GHOST_NDOFManager::sendMotionEvent() } else { // send no event and keep current state +#ifdef DEBUG_NDOF_MOTION + printf("ndof motion ignored -- %s\n", progress_string[data->progress]); +#endif delete event; return false; } -- cgit v1.2.3