Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2010, 10:25:27 AM (14 years ago)
Author:
scheusso
Message:

merged rocket branch into presentation3 and cleaned up some things (mostly debug output and intendation)

Location:
code/branches/presentation3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc

    r6598 r6951  
    364364        Ogre::RaySceneQueryResult& result = rsq->execute();
    365365        Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
     366        WorldEntity* myWe = static_cast<WorldEntity*>(this->getControllableEntity());
    366367
    367368        Ogre::RaySceneQueryResult::iterator itr;
    368369        for (itr = result.begin(); itr != result.end(); ++itr)
    369370        {
    370             if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" && itr->distance > 500)
     371//             CCOUT(0) << "testing object as target" << endl;
     372            if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" /*&& itr->distance > 500*/)
    371373            {
    372374                // Try to cast the user pointer
    373375                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
     376               
     377                // make sure we don't shoot ourselves
     378                if( wePtr==myWe )
     379                    continue;
     380               
    374381                if (wePtr)
    375382                {
     
    379386                    while (parent)
    380387                    {
    381                         if (this->targetMask_.isExcluded(parent->getIdentifier()))
     388                        if (this->targetMask_.isExcluded(parent->getIdentifier()) || parent==myWe)
    382389                        {
    383390                            parent = parent->getParent();
     
    579586        }
    580587    }
     588       
     589
     590   
     591
     592
    581593}
Note: See TracChangeset for help on using the changeset viewer.