Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10212


Ignore:
Timestamp:
Jan 31, 2015, 4:14:57 PM (5 years ago)
Author:
landauf
Message:

removed detach() from ModularSpaceShip which was just copy-pasted from its base class WorldEntity.
removed another unused function from WorldEntity.

Location:
code/branches/presentationFS14/src/orxonox/worldentities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h

    r10203 r10212  
    7272    {
    7373        friend class Scene;
    74         friend class ModularSpaceShip;
    7574
    7675        public:
     
    207206
    208207            void notifyChildPropsChanged();
    209 
    210             inline int getNumAttachedObj()
    211                 { return this->children_.size(); }
    212208
    213209        protected:
  • code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10211 r10212  
    4242#include "items/Engine.h"
    4343#include "worldentities/StaticEntity.h"
    44 #include "collisionshapes/WorldEntityCollisionShape.h"
    4544#include <BulletCollision/CollisionShapes/btCollisionShape.h>
    4645#include <BulletCollision/CollisionShapes/btCompoundShape.h>
     
    9291    {
    9392        // iterate through all attached objects
    94         for (unsigned int i=0; i < (unsigned int)(this->getNumAttachedObj()); i++)
     93        for (unsigned int i=0; i < this->getAttachedObjects().size(); i++)
    9594        {
    9695            if (this->getAttachedObject(i) == NULL)
     
    313312        }
    314313    }
    315 
    316     /**
    317     @brief
    318         Detaches a child WorldEntity from this instance.
    319     */
    320     void ModularSpaceShip::detach(WorldEntity* object)
    321     {
    322         std::set<WorldEntity*>::iterator it = this->children_.find(object);
    323         if (it == this->children_.end())
    324         {
    325             orxout(internal_warning) << "Cannot detach an object that is not a child." << endl;
    326             return;
    327         }
    328 
    329         // collision shapes
    330 
    331         //this->printBtChildShapes((btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape()), 2, 0);
    332         this->detachCollisionShape(object->collisionShape_);  // after succeeding, causes a crash in the collision handling
    333         //this->printBtChildShapes((btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape()), 2, 0);
    334 
    335         // mass
    336         if (object->getMass() > 0.0f)
    337         {
    338             this->childrenMass_ -= object->getMass();
    339             recalculateMassProps();
    340         }
    341 
    342         this->detachNode(object->node_);
    343         this->children_.erase(it);        // this causes a crash when unloading the level. Or not?
    344 
    345         object->notifyDetached();
    346     }
    347314}
  • code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h

    r10211 r10212  
    127127                { return this->rotationThrust_; }
    128128
    129             void detach(WorldEntity* object);
    130 
    131129            virtual void updatePartAssignment();
    132130
Note: See TracChangeset for help on using the changeset viewer.