- Timestamp:
- May 25, 2009, 11:16:27 PM (16 years ago)
- Location:
- code/trunk/src/orxonox/objects/worldentities
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/worldentities/CMakeLists.txt
r3033 r3077 6 6 ControllableEntity.cc 7 7 8 Attacher.cc 8 9 Backlight.cc 9 10 Billboard.cc -
code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc
r2855 r3077 69 69 this->parent_ = 0; 70 70 this->parentID_ = OBJECTID_UNKNOWN; 71 this->bDeleteWithParent_ = true; 71 72 72 73 this->node_->setPosition(Vector3::ZERO); … … 108 109 109 110 for (std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ) 110 delete (*(it++)); 111 { 112 if ((*it)->getDeleteWithParent()) 113 delete (*(it++)); 114 else 115 { 116 this->detach(*it); 117 (*it)->setPosition(this->getWorldPosition()); 118 ++it; 119 } 120 } 111 121 112 122 if (this->physicalBody_) … … 138 148 XMLPortParamLoadOnly(WorldEntity, "pitch", pitch_xmlport, xmlelement, mode); 139 149 XMLPortParamLoadOnly(WorldEntity, "roll", roll_xmlport, xmlelement, mode); 150 XMLPortParam (WorldEntity, "deletewithparent", setDeleteWithParent, getDeleteWithParent, xmlelement, mode); 140 151 141 152 // Physics -
code/trunk/src/orxonox/objects/worldentities/WorldEntity.h
r2851 r3077 173 173 void detachFromNode(Ogre::SceneNode* node); 174 174 175 inline void setDeleteWithParent(bool value) 176 { this->bDeleteWithParent_ = value; } 177 inline bool getDeleteWithParent() const 178 { return this->bDeleteWithParent_; } 179 175 180 void notifyChildPropsChanged(); 176 181 … … 200 205 unsigned int parentID_; 201 206 std::set<WorldEntity*> children_; 207 bool bDeleteWithParent_; 202 208 203 209
Note: See TracChangeset
for help on using the changeset viewer.