Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6114


Ignore:
Timestamp:
Nov 21, 2009, 1:29:48 AM (14 years ago)
Author:
scheusso
Message:

NHC goes now through all parents of raytraced objects in order to check with the ClassTreeMask

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc

    r6113 r6114  
    161161                if (wePtr)
    162162                {
    163                     BaseObject* parent = wePtr->getParent();
    164                     if (this->targetMask_.isExcluded(parent->getIdentifier()))
     163                    // go through all parents of object and look wheter they are Sightable or not
     164                    bool isSightable = false;
     165                    WorldEntity* parent = wePtr->getParent();
     166                    while( parent )
     167                    {
     168                        if (this->targetMask_.isExcluded(parent->getIdentifier()))
     169                        {
     170                            parent = parent->getParent();
     171                            continue;
     172                        }
     173                        else
     174                        {
     175                            isSightable = true;
     176                            break;
     177                        }
     178                    }
     179                    if ( !isSightable )
    165180                        continue;
    166181                }
Note: See TracChangeset for help on using the changeset viewer.