diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-12 12:30:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-12 14:05:24 +0400 |
commit | b9bf935cc32d456d6d8ada8ec24fe809698d295b (patch) | |
tree | 071d43c393aee41d74c37b98d13e3ed4e6677e2b /intern | |
parent | bc41d255cbe88875b1e5a6f32a135ba4dd89d3f7 (diff) |
NDOF/X11: fix for glitch using ndof outside the view and entering again
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_NDOFManager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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; } |