Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6489


Ignore:
Timestamp:
Mar 8, 2010, 8:09:17 AM (15 years ago)
Author:
dafrick
Message:

Changed changedActivity and changedVisibility such that when transiting to inactive/invisible the current activity/visibility of all atached objects is saved by them and restored once the parent node transits to active/visible again.

Location:
code/branches/pickup3/src/orxonox/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/orxonox/worldentities/WorldEntity.cc

    r6485 r6489  
    8181        this->node_->setPosition(Vector3::ZERO);
    8282        this->node_->setOrientation(Quaternion::IDENTITY);
     83       
     84        // Activity and visibility memory.
     85        this->bActiveMem_ = true;
     86        this->bVisibleMem_ = true;
    8387
    8488
     
    212216        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    213217        {
    214             (*it)->setActive(this->isActive());
     218            if(!this->isActive())
     219            {
     220                (*it)->bActiveMem_ = (*it)->isActive();
     221                (*it)->setActive(this->isActive());
     222            }
     223            else
     224            {
     225                (*it)->setActive((*it)->bActiveMem_);
     226            }
    215227        }
    216228    }
     
    226238        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    227239        {
    228             (*it)->setVisible(this->isVisible());
     240            if(!this->isVisible())
     241            {
     242                (*it)->bVisibleMem_ = (*it)->isVisible();
     243                (*it)->setVisible(this->isVisible());
     244            }
     245            else
     246            {
     247                (*it)->setVisible((*it)->bVisibleMem_);
     248            }
    229249        }
    230250    }
  • code/branches/pickup3/src/orxonox/worldentities/WorldEntity.h

    r6485 r6489  
    235235            std::set<WorldEntity*> children_;
    236236            bool bDeleteWithParent_;
     237           
     238            bool bActiveMem_;
     239            bool bVisibleMem_;
    237240
    238241
Note: See TracChangeset for help on using the changeset viewer.