Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2009, 11:16:27 PM (15 years ago)
Author:
landauf
Message:

Added Attacher - a class which attaches itself to an object with a given name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc

    r2855 r3077  
    6969        this->parent_ = 0;
    7070        this->parentID_ = OBJECTID_UNKNOWN;
     71        this->bDeleteWithParent_ = true;
    7172
    7273        this->node_->setPosition(Vector3::ZERO);
     
    108109
    109110            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            }
    111121
    112122            if (this->physicalBody_)
     
    138148        XMLPortParamLoadOnly(WorldEntity, "pitch",       pitch_xmlport,        xmlelement, mode);
    139149        XMLPortParamLoadOnly(WorldEntity, "roll",        roll_xmlport,         xmlelement, mode);
     150        XMLPortParam        (WorldEntity, "deletewithparent", setDeleteWithParent, getDeleteWithParent, xmlelement, mode);
    140151
    141152        // Physics
Note: See TracChangeset for help on using the changeset viewer.