[Bf-blender-cvs] [b9bf935] master: NDOF/X11: fix for glitch using ndof outside the view and entering again
Campbell Barton
noreply at git.blender.org
Wed Feb 12 11:08:54 CET 2014
Commit: b9bf935cc32d456d6d8ada8ec24fe809698d295b
Author: Campbell Barton
Date: Wed Feb 12 19:30:58 2014 +1100
https://developer.blender.org/rBb9bf935cc32d456d6d8ada8ec24fe809698d295b
NDOF/X11: fix for glitch using ndof outside the view and entering again
===================================================================
M intern/ghost/intern/GHOST_NDOFManager.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp
index d62d443..f8c707b 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;
}
More information about the Bf-blender-cvs
mailing list