Revision: 8153
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8153&view=rev
Author:   hsujohnhsu
Date:     2009-07-29 22:39:45 +0000 (Wed, 29 Jul 2009)

Log Message:
-----------
stop physics loop from updating when manipulating object poses through gui.

Modified Paths:
--------------
    code/gazebo/trunk/server/gui/GLWindow.cc

Modified: code/gazebo/trunk/server/gui/GLWindow.cc
===================================================================
--- code/gazebo/trunk/server/gui/GLWindow.cc    2009-07-28 10:43:36 UTC (rev 
8152)
+++ code/gazebo/trunk/server/gui/GLWindow.cc    2009-07-29 22:39:45 UTC (rev 
8153)
@@ -52,6 +52,8 @@
 #include "GLFrame.hh"
 #include "GLWindow.hh"
 
+#include <boost/thread.hpp>
+
 using namespace gazebo;
 
 GLWindow *GLWindow::activeWin = NULL;
@@ -271,6 +273,9 @@
 /// Handle a mouse drag
 void GLWindow::HandleMouseDrag()
 {
+  // stop simulation when this is happening
+  boost::recursive_mutex::scoped_lock 
lock(*Simulator::Instance()->GetMRMutex());
+
   if (this->activeCamera && this->activeCamera->GetUserMovable())
   {
     Vector2<int> drag = this->mousePos - this->prevMousePos;
@@ -483,6 +488,9 @@
 // Handle mouse wheel movement
 void GLWindow::HandleMouseWheel(int dx, int dy)
 {
+  // stop simulation when this is happening
+  boost::recursive_mutex::scoped_lock 
lock(*Simulator::Instance()->GetMRMutex());
+
   Entity *entity = Simulator::Instance()->GetSelectedEntity();
 
   if (entity->IsModel() || entity->IsBody())


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to