Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/collisionshapes/CollisionShape.cc

    r10216 r10624  
    4141#include "CompoundCollisionShape.h"
    4242#include "WorldEntityCollisionShape.h"
     43#include "Scene.h"
    4344
    4445namespace orxonox
    4546{
    46     RegisterAbstractClass(CollisionShape).inheritsFrom(Class(BaseObject)).inheritsFrom(Class(Synchronisable));
     47    RegisterAbstractClass(CollisionShape).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>();
    4748
    4849    /**
     
    7475    {
    7576        // Detach from parent CompoundCollisionShape.
    76         if (this->isInitialized() && this->parent_)
    77             this->parent_->detach(this);
     77        if (this->isInitialized())
     78        {
     79            if (this->getScene() && this->getScene()->isUpdatingPhysics())
     80                orxout(internal_error) << "Don't destroy collision shapes while the physics is updated! This will lead to crashes. Try to use destroyLater() instead" << endl;
     81
     82            if (this->parent_)
     83                this->parent_->detach(this);
     84
     85            if (this->collisionShape_)
     86                delete this->collisionShape_;
     87        }
    7888    }
    7989
  • code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc

    r9667 r10624  
    7171                it->first->notifyDetached();
    7272                it->first->destroy();
     73                if (this->collisionShape_ == it->second)
     74                    this->collisionShape_ = NULL; // don't destroy it twice
    7375            }
    7476
    7577            delete this->compoundShape_;
     78            if (this->collisionShape_ == this->compoundShape_)
     79                this->collisionShape_ = NULL; // don't destroy it twice
    7680        }
    7781    }
  • code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc

    r9667 r10624  
    3737namespace orxonox
    3838{
     39    RegisterClass(WorldEntityCollisionShape);
     40
    3941    WorldEntityCollisionShape::WorldEntityCollisionShape(Context* context) : CompoundCollisionShape(context)
    4042    {
     
    4446        // suppress synchronisation
    4547        this->setSyncMode(ObjectDirection::None);
    46     }
    47 
    48     WorldEntityCollisionShape::~WorldEntityCollisionShape()
    49     {
    50         // Called always by WE destructor
    5148    }
    5249
  • code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h

    r9667 r10624  
    3939        public:
    4040            WorldEntityCollisionShape(Context* context);
    41             virtual ~WorldEntityCollisionShape();
    4241
    4342            inline void setWorldEntityOwner(WorldEntity* worldEntityOwner)
Note: See TracChangeset for help on using the changeset viewer.