[Orxonox-commit 1396] r6114 - code/branches/presentation2/src/orxonox/controllers

scheusso at orxonox.net scheusso at orxonox.net
Sat Nov 21 01:29:48 CET 2009


Author: scheusso
Date: 2009-11-21 01:29:48 +0100 (Sat, 21 Nov 2009)
New Revision: 6114

Modified:
   code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
Log:
NHC goes now through all parents of raytraced objects in order to check with the ClassTreeMask


Modified: code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	2009-11-21 00:16:35 UTC (rev 6113)
+++ code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	2009-11-21 00:29:48 UTC (rev 6114)
@@ -160,8 +160,23 @@
                 WorldEntity* wePtr = dynamic_cast<WorldEntity*>(itr->movable->getUserObject());
                 if (wePtr)
                 {
-                    BaseObject* parent = wePtr->getParent();
-                    if (this->targetMask_.isExcluded(parent->getIdentifier()))
+                    // go through all parents of object and look wheter they are Sightable or not
+                    bool isSightable = false;
+                    WorldEntity* parent = wePtr->getParent();
+                    while( parent )
+                    {
+                        if (this->targetMask_.isExcluded(parent->getIdentifier()))
+                        {
+                            parent = parent->getParent();
+                            continue;
+                        }
+                        else
+                        {
+                            isSightable = true;
+                            break;
+                        }
+                    }
+                    if ( !isSightable )
                         continue;
                 }
                 




More information about the Orxonox-commit mailing list