Revision: 7522
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7522&view=rev
Author:   hsujohnhsu
Date:     2009-03-17 01:40:09 +0000 (Tue, 17 Mar 2009)

Log Message:
-----------
disable Generic_Camera if not active.

Modified Paths:
--------------
    
code/gazebo/branches/ogre-1.4.9/server/controllers/camera/generic/Generic_Camera.cc

Modified: 
code/gazebo/branches/ogre-1.4.9/server/controllers/camera/generic/Generic_Camera.cc
===================================================================
--- 
code/gazebo/branches/ogre-1.4.9/server/controllers/camera/generic/Generic_Camera.cc
 2009-03-17 01:38:53 UTC (rev 7521)
+++ 
code/gazebo/branches/ogre-1.4.9/server/controllers/camera/generic/Generic_Camera.cc
 2009-03-17 01:40:09 UTC (rev 7522)
@@ -86,7 +86,24 @@
 // Update the controller
 void Generic_Camera::UpdateChild()
 {
-  this->PutCameraData();
+
+  // do this first so there's chance for sensor to run 1 frame after activate
+  if (this->myParent->IsActive())
+    this->PutCameraData();
+
+  // activate if iface open
+  if (this->cameraIface->Lock(1))
+  {
+    if (this->cameraIface->GetOpenCount() > 0)
+      this->myParent->SetActive(true);
+    else
+      this->myParent->SetActive(false);
+
+    //std::cout << " camera open count " << this->cameraIface->GetOpenCount() 
<< std::endl;
+    this->cameraIface->Unlock();
+  }
+  //std::cout << " camera     active " << this->myParent->IsActive() << 
std::endl;
+
 }
 
 
////////////////////////////////////////////////////////////////////////////////


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

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to