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:
authorCampbell Barton <ideasman42@gmail.com>2014-02-12 12:30:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-12 14:05:24 +0400
commitb9bf935cc32d456d6d8ada8ec24fe809698d295b (patch)
tree071d43c393aee41d74c37b98d13e3ed4e6677e2b
parentbc41d255cbe88875b1e5a6f32a135ba4dd89d3f7 (diff)
NDOF/X11: fix for glitch using ndof outside the view and entering again
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.cpp5
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;
}