Changeset 6524 for code/trunk/src/orxonox/worldentities/WorldEntity.cc
- Timestamp:
- Mar 15, 2010, 3:27:09 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/worldentities/WorldEntity.cc
r6501 r6524 81 81 this->node_->setPosition(Vector3::ZERO); 82 82 this->node_->setOrientation(Quaternion::IDENTITY); 83 84 // Activity and visibility memory. 85 this->bActiveMem_ = true; 86 this->bVisibleMem_ = true; 83 87 84 88 … … 201 205 registerVariable(this->parentID_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged)); 202 206 } 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 } 203 251 204 252 /**
Note: See TracChangeset
for help on using the changeset viewer.