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:
2 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
Note: See TracChangeset for help on using the changeset viewer.