Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 13, 2014, 12:38:37 PM (10 years ago)
Author:
noep
Message:

Fixed CollisionShapes of ShipParts reappearing at their spawnposition after destruction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10053 r10054  
    128128        this->partMap_[entity] = part;
    129129
    130         //This adds a list of SmartPointers for all StaticEntities which have a ShipPart, preventing them from getting deleted. Hopefully.
    131         SmartPtr<StaticEntity> newSmartPtr = entity;
    132         SmartPtr<StaticEntity>* one = &newSmartPtr;
    133         this->entityPtrList_.push_back(one);
    134 
    135         //this->createCSPtrList(this->getWorldEntityCollisionShape());
    136 
    137130        orxout() << "New entity-part assignment created!" << endl;
    138131    }
    139132
    140     // This should add smartPointers to all (Orxonox)Collisionshapes of this SpaceShip, preventing them fromg etting deleted. Might not work due to weird acting getAttachedShape
    141     void ModularSpaceShip::createCSPtrList(CompoundCollisionShape* cs) // FIXME: (noep) remove debug
    142     {
    143         for (int i=0; i < cs->getNumChildShapes(); i++)
    144         {
    145 
    146             if (!orxonox_cast<CompoundCollisionShape*>(cs->getAttachedShape(i)))
    147             {
    148                 SmartPtr<CollisionShape> newSmartPtr = cs->getAttachedShape(i);
    149                 SmartPtr<CollisionShape>* one = &newSmartPtr;
    150                 this->csPtrList_.push_back(one);
    151             }
    152 
    153             if (orxonox_cast<CompoundCollisionShape*>(cs->getAttachedShape(i)))
    154                 createCSPtrList((CompoundCollisionShape*)(cs->getAttachedShape(i)));
    155 
    156         }
    157     }
    158133
    159134    /**
     
    305280            {
    306281                this->detach(itt->first);
    307                 //itt->first->destroy();
     282                itt->first->destroy();
    308283                //itt->first->setActive(false);
    309284                //itt->first->setVisible(false);
Note: See TracChangeset for help on using the changeset viewer.