Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2010, 3:27:09 PM (14 years ago)
Author:
dafrick
Message:

Merged pickup branch into trunk. Yay. Persisting bugs will be fixed, very soon.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r6501 r6524  
    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
     
    201205        registerVariable(this->parentID_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));
    202206    }
     207   
     208    /**
     209    @brief
     210        When the activity is changed, it is changed for all attached objects as well.
     211    */
     212    void WorldEntity::changedActivity(void)
     213    {
     214        SUPER(WorldEntity, changedActivity);
     215       
     216        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
     217        {
     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            }
     227        }
     228    }
     229   
     230    /**
     231    @brief
     232        When the visibility is changed, it is changed for all attached objects as well.
     233    */
     234    void WorldEntity::changedVisibility(void)
     235    {
     236        SUPER(WorldEntity, changedVisibility);
     237       
     238        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
     239        {
     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            }
     249        }
     250    }
    203251
    204252    /**
Note: See TracChangeset for help on using the changeset viewer.