Revision: 8561 http://playerstage.svn.sourceforge.net/playerstage/?rev=8561&view=rev Author: hsujohnhsu Date: 2010-02-27 01:45:33 +0000 (Sat, 27 Feb 2010)
Log Message: ----------- fix gui interface for force application. Modified Paths: -------------- code/gazebo/trunk/server/gui/GLWindow.cc Modified: code/gazebo/trunk/server/gui/GLWindow.cc =================================================================== --- code/gazebo/trunk/server/gui/GLWindow.cc 2010-02-27 01:22:24 UTC (rev 8560) +++ code/gazebo/trunk/server/gui/GLWindow.cc 2010-02-27 01:45:33 UTC (rev 8561) @@ -165,7 +165,8 @@ // continuously apply force to selected body Entity *entity = Simulator::Instance()->GetSelectedEntity(); - if (entity->IsBody()) + if (entity->IsBody() && + (this->keys[FL_Control_L] || this->keys[FL_Control_R]) ) { Body *body = (Body*)(entity); if (this->rightMousePressed && body) @@ -205,6 +206,10 @@ /// Handle a mouse button push void GLWindow::HandleMousePush() { + // reset applied forces to 0 + this->forceVec = 0; + this->torqueVec = 0; + // Get the mouse button that was pressed (if one was pressed) switch (Fl::event_button()) { @@ -256,13 +261,10 @@ Model *model = Simulator::Instance()->GetParentModel(entity); Body *body = Simulator::Instance()->GetParentBody(entity); - if (currModel == model) - { - Simulator::Instance()->SetSelectedEntity(NULL); - return; - } + // reset applied forces to 0 + this->forceVec = 0; + this->torqueVec = 0; - switch (Fl::event_button()) { case FL_LEFT_MOUSE: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit